Add Custom JS - Essential Theme

Re: Add Custom JS - Essential Theme

by Mary Evans -
Number of replies: 1
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi,

As you already know,, every Moodle course, category and sub-category are issued with a unique ID number

These ID numbers are converted into body classes which only appear in body section of the page source when that page is viewed in the users browser window.

Top level category body class is listed before the course body class

so the CSS needs to be category first course last

For Example: category > course

.category-2.course-5

However the sub level category body class is listed after the course body class

so the CSS needs to be course first sub-category last

For example: course -> sub-category

.course-3.category-3

I hope this helps?

Mary

Average of ratings: Useful (1)
In reply to Mary Evans

Re: Add Custom JS - Essential Theme

by Avata Tadeo -

Hi Mary,

thanks a lot for your help and quick replies! It did work how you said, but only for parent categories. In order to make this CSS work for every subcategory, i had to use custom Javascript. Managed to do so, editing the config.php and adding a new .js file. 

Again, thanks for your help!

best regards