How to override lib template ?

How to override lib template ?

by Javier Cuadrado -
Number of replies: 5

Hello,

I'm trying to override this template: lib/templates/navbar.mustache

I've copied this file here: theme/javier/templates/lib/navbar.mustache

I've also tried:

theme/javier/templates/theme_lib/navbar.mustache theme/javier/templates/navbar.mustache

But it doesn't work. 

I think I'm missing something to override lib templates. It seems different to the classic boost override.

Thanks in advance ! 

Average of ratings: -
In reply to Javier Cuadrado

Re: How to override lib template ?

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
How is this different to https://moodle.org/mod/forum/discuss.php?d=428095 ? There is no 'lib' theme. If your theme is a child theme of Boost then it needs to override its version, not libs. If not then it needs to reference the one you want in the mustache template that is called from the PHP that is specified for the page layout in the theme's config.php file.
In reply to Gareth J Barnard

Re: How to override lib template ?

by Javier Cuadrado -
Hi Gareth,

Thanks for your quick answer !

In this ticket, the navbar.mustache template that I want to modify refers to the breadcrumbs navbar. It is not in a theme folder inside boost.
It is in a templates folder located directly in moodle/lib/templates.

My last ticket was about the main navbar, this navbar.mustache template is inside the boost themes.

(I've added below a screenshot to show that both are differents).

I was following the override pattern for themes but it does not work for this template...

I hope this helps to clarify my question !

navbar.mustache
In reply to Javier Cuadrado

Re: How to override lib template ?

by Javier Cuadrado -
I am still stuck at this point sad

All advice is welcome !!