[ARCHIVED] Display course title breadcrumbs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2018
02:10 PM
I have a question and I'm hoping someone could lend some advice. We have some code to display the course title in the breadcrumbs and course term and course code above the course menu. Now when on user's details page in a course, it no longer works. Here's the code:
$(document).ready(function() {
if ($("body").attr("class").match(/\bcontext-course_(.[0-9]*)/)) {
//insert course ID into variable
var courseID = $("body").attr("class").match(/\bcontext-course_(.[0-9]*)/)[1];
$.getJSON("/api/v1/courses/" + courseID, "include[]=term", function(data) {
$("#breadcrumbs ul li:nth-child(2) a span.ellipsible").html(data.name);
$('#section-tabs-header-subtitle.ellipsis').html(data.term.name + '<br>' + data.course_code);
}); //end get jSON
}//end check if it is a course
});//end on document ready
I'm stumped as to why it's not triggering on a user's details page when in a course and I really want that a-ha! moment.
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.