In a course, in the navigation on the top left (are they called breadcrumbs?) I get something like:
mysite >> course
What I would really like is
mysite >> category >> subcategory >> subcategory >> course
Is there a way of doing this?
It never occurred to me, but I agree it would be very useful. I am forever going back and forth between pages to get to other categories.
--Mary
Thanks, Mike! That's just what I needed.
For the record, my header file is header.html, not php, but putting the php code in worked just fine.
A note to others - Mike has two lines of code you can swap out by swapping the comment (//) markers that lets you decide if you want the link "course categories" included in your breadcrumb trail.
Very nice, at last a real breadcrumb bar!
(I like your option to show/not show the course categories!)
In my version the bar breaks into two bars ( before the first subcategory)
Can I prevent that?
One little bug in this feature, as distributed here: you need the top frame name in the breadcrumb trail links. A cleaner coding of this is still needed, but you can get it functioning just by hardcoding in the frame name to your hack as below:
if (is_object($course)) {
$nav = $navigation;
$cattree = get_record("course_categories", "id", $course->category);
$linkcss = $cattree->visible ? "" : " class="dimmed" ";
$nav = "<a $linkcss title="".htmlspecialchars($cattree->description)."" "
."target="_top" href="$CFG->wwwroot/course/category.php?id=$cattree->id">$cattree->name</a> -> "
.$nav;
while ($cattree->parent) {
$cattree = get_record("course_categories", "id", $cattree->parent);
$linkcss = $cattree->visible ? "" : " class="dimmed" ";
$nav = "<a $linkcss title="".htmlspecialchars($cattree->description)."" "
." target="_top" href="$CFG->wwwroot/course/category.php?id=$cattree->id">$cattree->name</a> -> "
.$nav;
}
Does anybody have code for doing this in 1.7.1?
I would like to see:
Site > Category > Sub-category > Course > Activity
when I am in a course/activity, but it reverts to:
Site > Course
when you click on the course.
The instructions provided don't seem to be valid in 1.7.1 because of code changes and the fact that the navbar is containd within a <div> now. Any help?
Thanks.
Brian
Can't solve your $navigation problem exactly, but hopefully you followed all the steps in converting your db to utf8 before the upgrade AND hopefully you did a stepped upgraded from 1.6 to 1.7 then to 1.8 then to 1.9.
I just recently upgraded from 1.6 to 1.9 (did 1.7 then 1.8 first) and have no noticeable problems.
See this link for details on upgrade: