General developer forum

How to add breadcrumbs below the page heading ?

 
Picture of Amrata Ramchandani
How to add breadcrumbs below the page heading ?
Group Plugin developers

Hi,

I am working on one of the plugins in which i am creating few pages.

I would like to know how to add breadcrumbs to the page,below the page heading.As normally in moodle we have.

And,also the navigation block on the left side.

I tried playing around with $PAGE->set_context() and $PAGE->set_pagelayout() but none of them worked out.

I have attached the images below as an example of something similar I am looking for.



 
Average of ratings: -
Picture of Neill Magill
Re: How to add breadcrumbs below the page heading ?
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Have you found the Navigation API docs?

There is an example of how to directly modify the bread crumbs (navbar)

 
Average of ratings: -
Picture of Amrata Ramchandani
Re: How to add breadcrumbs below the page heading ?
Group Plugin developers

Yes,I saw that.

I am able to use navbar->add() but that would be too manipulative.

Moodle Should be able to put the navbar as and when I navigate,right ? I am not eve getting  the first few path too like Dashboard/ etc which is common to every moodle page.

I manually have to put them on each page,why so ?

 
Average of ratings: -
Picture of Neill Magill
Re: How to add breadcrumbs below the page heading ?
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers
Did you try adding extra items to the navigation tree in your plugins navigation callback?


If you add an item to the navigation that has the url of the page you want to modify the navigation for, then the bread crumbs would be automatically generated for it.


For example: https://github.com/moodle/moodle/blob/master/mod/quiz/lib.php#L1787

 
Average of ratings: -