Not the breadcrumb trail again...

Not the breadcrumb trail again...

by Mark Berthelemy -
Number of replies: 27
Hi everyone,

I know this has been discussed at length before.... but the breadcrumb trail as it currently stands is causing some problems with my users.

I know the reasons for having it as it currently stands; that it supposedly groups similar activities together to encourage exploration, but, from a learner's point of view, the fact that there is a bunch of SCORMs or a bunch of Lessons, or even a bunch of Forums is not really particularly relevant. And it can be quite confusing. I'm forever being asked by people, "OK, where do I go now?", as the breadcrumb trail bears little relation to where they think they've come from. The users I'm talking about are intelligent, IT-literate adults, who perhaps aren't well versed in the theories of social constructivism... smile

Here's a possible solution. I don't know how easy it would be to integrate into Moodle as it stands as I'm no PHP programmer, but I'm sure someone will tell me.

I suggest we offer site administrators two possible breadcrumb trails:

1) The "traditional":

Home Page > Course Home Page > Activity/Resource type > Activity/Resource name > Activity/Resource sub area

2) A new type:

Home Page > Category > Sub-category > Course Home Page > Topic/Week > Activity/Resource name > Activity/Resource sub area

This could be configured via a variable in the Admin > Variables page.

If the Topic link could include the word "Topic" as well as the topic number so much the better (since we don't yet have names for topics).

How feasible is this? I realise it's a change to the core rather than just a module, so potentially has wider implications...

Thanks,

Mark
Average of ratings: -
In reply to Mark Berthelemy

Re: Not the breadcrumb trail again...

by Michael Penney -
Hi Mark, I think it could be done, a bit hard though as you would need to track which topic the person came to the resource from.

Another solution is to just hide the thing all together and make your Homelink really largesmile.

Using a menu system like xtree, you can get to any resource from the block or maximize a topic from the left menu. IMO an ideal next step is to make the left menu persistent in most modules so it doesn't suddenly dissappear on the users (they hate that).

See http://cdc.humboldt.edu/moodletest/moodlebeta2, login as guest, for an example of our new xtree based course menu.
In reply to Michael Penney

Re: Not the breadcrumb trail again...

by N Hansen -
Michael-Is there a way to make your xtree menu wrap the words to the next line rather than chop them off in the middle? It's rather odd looking that way.
In reply to N Hansen

Re: Not the breadcrumb trail again...

by Michael Penney -
Hi N. yes there is a setting in the code for how many characters to cut at and also a way in the styles to let it wrap.

When I get a chance I'm going to see if these parameters can be set in the config file, but it will be a few weeks before I can get to that.
In reply to Michael Penney

Re: Not the breadcrumb trail again...

by seaghan moriarty -

Forgive my late addition to this thread. I saw Michael's Xtree navigation and would love to find out where to get this or how to do this .... Can anyone help me please?

TIA

In reply to Michael Penney

Re: Not the breadcrumb trail again...

by Paul Lamicela -
I'd like to know how to hide the breadcrumbs trail all together. I don't want it displaying on my site.
In reply to Paul Lamicela

Re: Not the breadcrumb trail again...

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

That's easy. Edit your current theme's header.html file, locate and remove this line (example given for Moodle 1.8):

<div class="breadcrumb"><?php print_navigation("$navigation"); ?></div>

However, this will really make navigation through your Moodle courses difficult. Are you absolutely certain you want to do this?thoughtful

Joseph

In reply to Mark Berthelemy

Re: Not the breadcrumb trail again...

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
This is indeed the plan (to make it flexible), but it's not just a change to the core, it's a change to practically every major script in Moodle, so it will take a little time.

Most efficient thing to do in the meantime might be just to educate your users ...

Otherwise someone might want to come up with a interim hack for print_navigation that tries to derive extra data from the environment.
In reply to Martin Dougiamas

Re: Not the breadcrumb trail again...

by Mark Berthelemy -
Thanks Martin,

I hadn't realised how pervasive a change it would require.

I'm not sure how serious you were about educating my users? IMO I would say that such a central aspect of a system as navigation ought not to require any educating of the users. It should be self-explanatory. There's always the opportunity later for teachers/course admins to add extra elements like the activities block to facilitate further exploration.

I do agree with Michael's point about losing navigation cues when you enter a module. Perhaps, now that modules can include blocks, that problem might be removed.

Mark
In reply to Mark Berthelemy

Re: Not the breadcrumb trail again...

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Here's a very simple interim hack for print_navigation (found in moodle\lib\weblib.php) that just removes the activity type link from the breadcrumb trail:

function print_navigation ($navigation) {
   global $CFG;
 
   if ($navigation) {
       if (! $site = get_site()) {
           $site->shortname = get_string("home");
       }

       $bits = explode('->', $navigation);
       if (count($bits) > 2) {
           array_splice($bits, 1, 1);
           $navigation = implode('->', $bits);
       }

       
       $navigation = str_replace('->', '&raquo;', $navigation);
       echo "<a target=\"{$CFG->framename}\" href=\"$CFG->wwwroot/\">$site->shortname</a> &raquo; $navigation";
   }
}


In reply to Helen Foster

Re: Not the breadcrumb trail again...

by N Hansen -
Hmm, now I'm not sure I like how this works. I just seems to remove the link, no matter whether it is an activity or not. For example, if someone views a particular participant from the participants link, then it removes the link to the all participants page. Considering how often my users like to view other participants, I think this is dangerous.
In reply to Mark Berthelemy

Re: Not the breadcrumb trail again...

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
Hi Mark -

I do something similar on a site I've set up. The breadcrumbs reflect the navigation tree, including categories and sub-categories, but don't include the activity index page.

So, you would see: "Home >> Category 1 >> Sub-Category1 >> Course 1 >> Activity"

I did this in the header file of the theme I created. I take advantage of the navigation string's global visibility and basically rebuild the navigation in this file before it gets written out. That way, I don't have to change the core code.

mike
In reply to Mike Churchward

Re: Not the breadcrumb trail again...

by N Hansen -
Mike-Could you post the code for this?
In reply to N Hansen

Re: Not the breadcrumb trail again...

by Darren Smith -
In reply to Darren Smith

Re: Not the breadcrumb trail again...

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
Thanks Darren...
...I knew that was somewhere...

Let me know if it doesn't quite do what I said it did. I know I've made a lot more changes to the header file, and I can repost the changes.

mike
In reply to Mike Churchward

Re: Not the breadcrumb trail again...

by N Hansen -
Mike, all it seems to do is add the course category on the main course page (even though I selected to not show course category-it doesn't show on other pages though). It still shows the activity type in the breadcrumb trail. 
In reply to N Hansen

Re: Not the breadcrumb trail again...

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
That code is there to display categories in the nav. It should do that.

Here's some code that will remove that activity and resource index pages. Put it before the other code.

mike
In reply to Mike Churchward

Re: Not the breadcrumb trail again...

by Mark Berthelemy -
Mike,

Belated I know, but these additions to header.html are precisely what I needed.

Thanks,

Mark
In reply to Mike Churchward

Re: Not the breadcrumb trail again...

by N Hansen -
I've been using Mike's hack to remove the activity index page from my breadcrumb trail, but now I have a course with topics in it that contain identically named activities and it makes it hard to keep track what topic I am in, which is the most important organizing principle in the course. So I was wondering if anyone knows how to tweak Mike's code to replace the activity index page with the particular topic that the activity belongs to.
In reply to N Hansen

Re: Not the breadcrumb trail again...

by N Hansen -
I just realized something else that Mike's hack misses, and that is the breadcrumb trail that appears in forum posts that are emailed. It still contains the "forums" crumb. Does anyone have a fix for this?
In reply to N Hansen

Re: Not the breadcrumb trail again...

by Chardelle Busch -
Picture of Core developers
Hi Nicole,

Look in forum/lib.php for the make_mail functions for both html and text.

E.g. for make_mail_html delete this line:

    '<a target="_blank" href="'.$CFG->wwwroot.'/mod/forum/index.php?id='.$course->id.'">'.$strforums.'</a> &raquo; '.

For text try just deleting  this:
$posttext  = "$course->shortname -> $strforums ->  ".format_string($forum->name,true);

In reply to Mark Berthelemy

Re: New breadcrumbs...or new course format?

by N Hansen -
You know, I'm wondering whether it wouldn't be better to implement this through a new course format, not simply the breadcrumbs. It could use the x-tree navigation and feature one topic/week per page. Then the breadcrumbs in that format would show the topic/week instead of the activity type. 
In reply to Mark Berthelemy

Re: Not the breadcrumb trail again...

by Thomas Robb -
I think the crux of the matter is that the breadcrumb trail should reflect the path that the user clicked through to get to the current activity.  In reality, most users click on a link in one of the central weekly/topic blocks and are taken directly to the module.  They therefore naturally tend to click on the next item up on the breadcrumb trail and are somewhat confusingly not brought back from whence they came.

I think there is a strong argument for simply removing the module category from the breadcrumb trail, simply making it

site->course->module

rather than

site->course->module_type->module

I guess the main question is which is more common, wanting to revert to the main course page after doing an activity, or wanting to visit another activity of the same type.  For my particular instructional situation, the former is clearly more frequent.
In reply to Thomas Robb

Re: Not the breadcrumb trail again...

by Darren Smith -

With regards to your last point I find this is exactly the same in my establishment.

What I have done is placed a link in the header which basically says 'if looking at a resource or activity then show a link to the course page'. Now it's working (thanks to wild girl) I notice the students click on it all of the time - I haven't even told them it is there.

We also have the breadcrumb hack which mike provided but In our 1.5 I am considering removing the breadcrumbs all together.

Attachment moodle_001.jpg
In reply to Thomas Robb

Re: Not the breadcrumb trail again...

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Firstly, it's not a breadcrumb trail (like Hansel and Gretel) it's a navigation bar. "Whence they came" makes no sense when you can jump around a web site in any order.

Secondly, can everyone who wants to partake in this thread please read this other one first since I think pretty much every side to this is in there already.

Thirdly, look in that discussion for "navmenulist" ... 1.5 provides data to the theme so that themes can create a persistent menu structure on every page. No themes are using this yet, but it can provide a site map (like the Jump menu) that you can make more obvious.

Lastly, the long-term plan is to move everything towards using the PAGE classes, which will allow more intelligence in how the navigation bar is constructed and displayed. In turn this will allow the admin to decide what elements they want in there. (categories or not, activity indexes or not). But it's a major change.
In reply to Martin Dougiamas

Re: Not the breadcrumb trail again...

by N Hansen -
I agree with Martin, we don't want it to be "whence they came." That's what the back button in your browser is for. It's better that whatever it is, it be consistent and persistent. That way students know what to expect. I've installed Mike's hack now, but it suffers from the same flaw as Wild Girl's, namely that it is all or nothing and takes out the link to the participants page if you are looking at a particular participant. I'm happy to keep all the crumbs, with the exception of the pages with the activities grouped by type. Participants, however, I would like to keep. 
In reply to N Hansen

Re: Not the breadcrumb trail again...

by Chardelle Busch -
Picture of Core developers
Nicole,

You can go to each activity page that you want to change and simply delete the link to the activity index.  E.g., for  choice>view.php look for the line with the link to the index page,
                 "<a href=\"index.php?id=$course->id\">$strchoices</a> -> ".format_string($choice->name), "", "", true,

Then delete the name: $strchoices  and then delete the >> from the navbar by deleting the -> that follows the linked name.  Then the link to "Choices" will be gone from the nav bar.