Customize navigation in course format

Customize navigation in course format

by Percy D -
Number of replies: 4

Hello,

I have been looking into customizing the navigation block when I'm looking at the course home and within any activity of that course.

I just want to keep the "topic titles" and the activities titles and links under them (while inside a course home or within course activities of that course). In other words, I want to clean up the navigation block with items relevant to the course and nothing else.

I was looking at the course format lib.php and there is a method called: extend_course_navigation() which allows me to affect the navigation block. I was able to remove a few but can't find yet a successful way to just keep the navigation items I want. I need to remove the rest and have a simplified navigation while inside any course pages/activities (see the attached image)

Any code snippets or code references would be helpful.

Thank you,

Attachment new_nav.png
Average of ratings: -
In reply to Percy D

Re: Customize navigation in course format

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Percy,

To be honest I have no idea how to do this but I think there is information on http://docs.moodle.org/dev/Course_formats#Extending_course_navigation with possible snippets.  And the best person to ask at Moodle HQ is Marina Glancy.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Customize navigation in course format

by Percy D -

Gareth,

Thanks again for your reference. Let's hope we can get an answer back to my question, which is really helpful for anyone with similar customization needs.

Thanks,

Percy

In reply to Percy D

Re: Customize navigation in course format

by Marina Glancy -
Picture of Core developers Picture of Moodle HQ Picture of Moodle Workplace team Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

it seems that some answers were lost during our recent moodle.org crash.

My answer was:

Hi Percy,

I don't think it's possible through extend_course_navigation() because some items may be added to navigation after the code in course format.

I would recommend you to remove navigation block from the course and add another custom block (similar to blocks/section_links) that just displays the course navigation.

Marina

And further comment by Flotter Totte - Monday, October 21, 2013, 5:09 PM

Hi Percy,

we have created a course format and block which might help you.

Navigation is handled by a block which only contains links to the activities/resources of the course.

Here is a demo:

http://www.emeneo.com/em2/course/view.php?id=38

Flotter

Average of ratings: Useful (1)
In reply to Marina Glancy

Re: Customize navigation in course format

by Flotter Totte -
Picture of Plugin developers

Hi Marina, thanks a lot for including my post smile Flotter