Moodle

Add category to breadcrumbs

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.4.5
  • Fix Version/s: 2.0
  • Component/s: Course
  • Labels:
    None
  • Environment:
    All
  • Affected Branches:
    MOODLE_14_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

When in a course, in the breadcrumbs navigation moodle currently displays something like:

mysite >> course

Instead of the more logical:

mysite >> category >> subcategory >> subcategory >> course

The new proposal would allow easier navigation between courses within the same categories rather than have to return to the first page every time.

Issue discussed in forum posts here http://moodle.org/mod/forum/discuss.php?d=16850

  1. MDL-2347.patch.txt
    11/May/09 5:44 PM
    7 kB
    David Mudrak
  2. MDL-2347.patch-2.txt
    11/May/09 10:28 PM
    2 kB
    David Mudrak

Issue Links

Activity

Hide
Martin Dougiamas added a comment -

From Timothy Allen (scop at hannam.ac.kr) Saturday, 8 January 2005, 08:57 PM:

This would be great for an admin or course creator, but not for a student, most of whom are in only one course. Even when they are in more than one course, they have their courses block.

So I think if this is included it should only be available for admins/course creators, or at least configuarble.

From Darren Smith (dagza72 at gmail.com) Saturday, 8 January 2005, 09:50 PM:

If it were to be included then I would like it to be configurable as my students would find it useful. I agree about the course block but my students belong to many courses per category as other subjects are increasingly using moodle.

Show
Martin Dougiamas added a comment - From Timothy Allen (scop at hannam.ac.kr) Saturday, 8 January 2005, 08:57 PM: This would be great for an admin or course creator, but not for a student, most of whom are in only one course. Even when they are in more than one course, they have their courses block. So I think if this is included it should only be available for admins/course creators, or at least configuarble. From Darren Smith (dagza72 at gmail.com) Saturday, 8 January 2005, 09:50 PM: If it were to be included then I would like it to be configurable as my students would find it useful. I agree about the course block but my students belong to many courses per category as other subjects are increasingly using moodle.
Hide
Timothy Takemoto added a comment -

Is this still open? Daniele Cordella mentions
$CFG->showcategoryinbreadcrumb (to see the category name in breadcrumb)
http://moodle.org/mod/forum/discuss.php?d=56868
I agree that it would be great for admins but not much use to students, since I am using
CFG->showcoursesinhiddencategories
I would not want to show hidden categories in the breadcrumbs

Show
Timothy Takemoto added a comment - Is this still open? Daniele Cordella mentions $CFG->showcategoryinbreadcrumb (to see the category name in breadcrumb) http://moodle.org/mod/forum/discuss.php?d=56868 I agree that it would be great for admins but not much use to students, since I am using CFG->showcoursesinhiddencategories I would not want to show hidden categories in the breadcrumbs
Hide
Daniele Cordella added a comment -
Show
Daniele Cordella added a comment - Here is a very draft code. http://moodle.org/mod/forum/discuss.php?d=69576
Hide
Nadav Kavalerchik added a comment -

see a partial patch for this issue

http://tracker.moodle.org/browse/MDL-17624

i was asked by our teachers to have only one upper category visible in the navigation bar
because they put all their courses (belonging to one school) in the same category. and thus...
students can go UP to the school's category list of courses if they wish to navigate
to another (un enrolled) course.

Show
Nadav Kavalerchik added a comment - see a partial patch for this issue http://tracker.moodle.org/browse/MDL-17624 i was asked by our teachers to have only one upper category visible in the navigation bar because they put all their courses (belonging to one school) in the same category. and thus... students can go UP to the school's category list of courses if they wish to navigate to another (un enrolled) course.
Hide
Daniele Cordella added a comment -

An invasive but very well working patch (I went to modify the core of Moodle) is now attached.
As far as I tested, this solution is totally respectful of each admin needs and completely "moodle style".

Show
Daniele Cordella added a comment - An invasive but very well working patch (I went to modify the core of Moodle) is now attached. As far as I tested, this solution is totally respectful of each admin needs and completely "moodle style".
Hide
Daniele Cordella added a comment -

Sorry, I forget about hidden category. Their management added now.

Show
Daniele Cordella added a comment - Sorry, I forget about hidden category. Their management added now.
Hide
Daniele Cordella added a comment -

This one provide category tree even when category page is shown. It is my best release.

Show
Daniele Cordella added a comment - This one provide category tree even when category page is shown. It is my best release.
Hide
Eloy Lafuente (stronk7) added a comment -

Adding Tim and Helen as watchers.

I think this can be interesting to add. Also, I've commented with Daniele about:

  • Reduce the number of queries (right now it uses 1 per level).
  • Allow to configure the max number of categories to show (people can be interested into showing only one or two instead of the whole tree, for example)

Ciao

Show
Eloy Lafuente (stronk7) added a comment - Adding Tim and Helen as watchers. I think this can be interesting to add. Also, I've commented with Daniele about:
  • Reduce the number of queries (right now it uses 1 per level).
  • Allow to configure the max number of categories to show (people can be interested into showing only one or two instead of the whole tree, for example)
Ciao
Hide
Tim Hunt added a comment -

This is part of Navigation 2.0. Taking.

Show
Tim Hunt added a comment - This is part of Navigation 2.0. Taking.
Hide
Daniele Cordella added a comment -

I apologise Tim for writing this here. I don't know where I am supposed to write this. Still on "Navigation 2.0" topic I believe you should also take into account the block described in: http://moodle.org/mod/data/view.php?d=13&rid=1723. Ciao.

Show
Daniele Cordella added a comment - I apologise Tim for writing this here. I don't know where I am supposed to write this. Still on "Navigation 2.0" topic I believe you should also take into account the block described in: http://moodle.org/mod/data/view.php?d=13&rid=1723. Ciao.
Hide
Daniele Cordella added a comment -

Ciao Eloy
I went to check for the possibility to reduce the number of query according to what we discussed yesterday.

Well, in spite of the field "path" that actually provide all the category id in just one step and without any further query, I can't see any solution to reduce the number of query because:

  • for each category I need to check whether it is visible or not
  • and, further, I need its name.
    How can I omit the query for each category?
Show
Daniele Cordella added a comment - Ciao Eloy I went to check for the possibility to reduce the number of query according to what we discussed yesterday. Well, in spite of the field "path" that actually provide all the category id in just one step and without any further query, I can't see any solution to reduce the number of query because:
  • for each category I need to check whether it is visible or not
  • and, further, I need its name. How can I omit the query for each category?
Hide
David Mudrak added a comment -

In MDL-2347.patch.txt you can find the Daniele's patch catinnavmenu_20090227.zip prepared in one file to be applied. Thanks Daniele for this - it works great for me!

Show
David Mudrak added a comment - In MDL-2347.patch.txt you can find the Daniele's patch catinnavmenu_20090227.zip prepared in one file to be applied. Thanks Daniele for this - it works great for me!
Hide
Daniele Cordella added a comment -

Ciao David and thanks for your time and interest.
I found a small problem in my patch and I fixed it.
If you are inside a course and use the navigation menu to return to the course's parent category, you get an error 404.
The patch I am attaching fixes this trivial problem.

Show
Daniele Cordella added a comment - Ciao David and thanks for your time and interest. I found a small problem in my patch and I fixed it. If you are inside a course and use the navigation menu to return to the course's parent category, you get an error 404. The patch I am attaching fixes this trivial problem.
Hide
David Mudrak added a comment -

I found a problem, too. Maybe it is the same as yours, maybe not. What did not work with my last patch was the navigation produced a relative URL link to "category.php". So it did not work if you were somewhere else than in the main course page. For example, if you were in a module view page "mod/blahblah/view.php", the navigation produced link to "mod/blahblah/category.php" which leads to 404.

In attached MDL-2347.patch-2.txt there are three places I found needing the fix.

Show
David Mudrak added a comment - I found a problem, too. Maybe it is the same as yours, maybe not. What did not work with my last patch was the navigation produced a relative URL link to "category.php". So it did not work if you were somewhere else than in the main course page. For example, if you were in a module view page "mod/blahblah/view.php", the navigation produced link to "mod/blahblah/category.php" which leads to 404. In attached MDL-2347.patch-2.txt there are three places I found needing the fix.
Hide
Daniele Cordella added a comment -

The problem you described is the same I fixed.
I had no experience about the need to edit to the third instance you changed in addition to the two ones we corrected both.
Is this patch going to update the core of Moodle?

Show
Daniele Cordella added a comment - The problem you described is the same I fixed. I had no experience about the need to edit to the third instance you changed in addition to the two ones we corrected both. Is this patch going to update the core of Moodle?
Hide
Tim Hunt added a comment -

I will probably look at the patch, but then re-implement it myself based on the other Moodle 2.0 work. In 2.0 there will be no need for extra DB queries.

Show
Tim Hunt added a comment - I will probably look at the patch, but then re-implement it myself based on the other Moodle 2.0 work. In 2.0 there will be no need for extra DB queries.
Hide
David Mudrak added a comment -

Tim, any chances you find some time to look at the patch? TIA

Show
David Mudrak added a comment - Tim, any chances you find some time to look at the patch? TIA
Hide
David Mudrak added a comment -

Sam can you please confirm this issue is sorted out somehow in 2.0?

Show
David Mudrak added a comment - Sam can you please confirm this issue is sorted out somehow in 2.0?
Hide
Daniele Cordella added a comment -

yes, I can confirm it was already sorted out in moodle 2.
It is not in Moodle 1.9... if it was planned!!!

Show
Daniele Cordella added a comment - yes, I can confirm it was already sorted out in moodle 2. It is not in Moodle 1.9... if it was planned!!!
Hide
Sam Hemelryk added a comment - - edited

Hi guys, this has indeed been resolved in 2.0 as part of the navigation and output changes.
I'm not currently aware of any plans to include this in 1.9 but will check just to be sure

Show
Sam Hemelryk added a comment - - edited Hi guys, this has indeed been resolved in 2.0 as part of the navigation and output changes. I'm not currently aware of any plans to include this in 1.9 but will check just to be sure

Dates

  • Created:
    Updated:
    Resolved: