Custom JavaScript in Boost Theme

Re: Custom JavaScript in Boost Theme

by Chris Kenniburg -
Number of replies: 1
Picture of Particularly helpful Moodlers Picture of Plugin developers

Jeremy,

Today I had to figure this out and I can tell you how I did it.  

First, put custom javascript file in theme/javascript folder.  

https://github.com/dbnschools/moodle-theme_fordson/tree/master/javascript


Then call it in the theme layout file.  In this case I also had to use jquery as seen below.

https://github.com/dbnschools/moodle-theme_fordson/blob/master/layout/frontpage.php#L71-L72


Then it just seemed to work.  This was just to make a "back to top" scroll button appear.  I did not use the mustache template and i don't know how I would have done it differently.  

This worked for me and maybe it will help you.  The 3.3 version of Academi also calls some custom javascript so check out how they do it too.

Average of ratings: Useful (2)
In reply to Chris Kenniburg

Re: Custom JavaScript in Boost Theme

by Kaspar Bredahl Rasmussen -

Hi Chris

I have recently installed your presets for the flashcards using the database. Have you a new javascript fix for it? I only get the flip card botton but not the three others. I haven't be able to figure out a solution myself yet ...


And thanks for the inspiration to use the database ...

Kaspar