Boost Mustache Templates - Moodle 3.7

Re: Boost Mustache Templates - Moodle 3.7

by Andreas Grabs -
Number of replies: 1
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Translators

Hi Dave,

if you have a file "templates/core/loginform.mustache" in your theme then all is fine. If you also want to override the "templates/login.mustache" you need a file "templates/theme_boost/login.mustache"

That's the way templates work in moodle. In general you have to place a template in a folder with the full component name and in it the "mustache" file you want to override.

The loginform is a core component so the path in your theme is "templates/core/loginform.mustache"
The login.mustache comes from boost so the path is "templates/theme_boost/login.mustache"

Moodle look for templates in the following order.

  1. Current theme
  2. Parent theme of the current theme
  3. Component

What is found first will be used.

If you want to modify the context data that goes into the login.mustache you can override the file "layout/login.php" in the way I described in the last post.

Best regards
Andreas

Average of ratings: Useful (1)
In reply to Andreas Grabs

Re: Boost Mustache Templates - Moodle 3.7

by web dev -
Hi Gents,

apologies for barging in here...i am in a way in this theme limbo also.

i have struggled to find anything more linear in instructions or better than what Dave and Andreas have provided above.

i have also tried to modify Boost Campus with somewhat limited success (this just involved removing some list item elements to remove the Timeline tab from the Overview page) and want to create and modify a theme template the correct way.

Dave may i get some insight on how you went about creating the theme and where you placed the folders and files etc?

My main goal for the Overview page is to remove the Timeline tab and keep the Courses tab but only show the course available and do away with In progress, Future and Past course buttons altogether.

TIA
wd