Add Custom JS - Essential Theme

Re: Add Custom JS - Essential Theme

بواسطة - Mary Evans
عدد الردود: 1
صورة Core developers صورة Documentation writers صورة Peer reviewers صورة Plugin developers صورة 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

رداً على Mary Evans

Re: Add Custom JS - Essential Theme

بواسطة - 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