enable specific themes for category and courses

enable specific themes for category and courses

by romuald lorthioir -
Number of replies: 2

Hi,

I'm a french user of moodle so sorry for my english.

I've tried to create a specific header.html page to make specific theme for categories and courses. I've done something like this: 

If you are in a category, this page search for a theme in the /theme path with the same name as the category name (all special chars are replaced and the name is in uppercase) and use a style.css (plus the general style.php) and logo.jpg put in it. This directory have to be created manually.

for exemple:

category name: TOto est très content

path to seach: /theme/TOTO_EST_TRES_CONTENT/

If this directory doesn't exist, the page use the  logo you have choosen for the entire site. The general style.php is always include.

Next, i've done the same for courses. If you have a specific style.css and logo.jpg uploaded in your course path, then, when you are on a course page, this specific style and logo is used (i've used my version of another post in this forum). The category style.css is also include if existing and the general style.php is always include.

If this directory doesn't exist, the page use the category logo you have done for your category. In all cases, if the category directory exists, the style.css of the category is used. The general style.php is always include.

If this one doesn't exist, the page use the general theme and logo you have choosen for the entire site. 

I've to say that i'm a newbie in php and moodle. So, i want to have some comments on my code and the way i've done the job.

The header.htm is join.

Thank you in advance for your help.

 

 

 

Average of ratings: -
In reply to romuald lorthioir

Re: enable specific themes for category and courses

by romuald lorthioir -

Ok, i've tested and i think it works quiet well grand sourire.

So, if someone want to use it, you can.

If you find a bug or want an Howto (easier to understand than my post incertain) , just ask.

If you have another solution, i listen to you pensif.

Thanks.

In reply to romuald lorthioir

Re: enable specific themes for category and courses

by Ger Tielemans -

Is it also possible to include - inside your condition fields - a list of blocks for each course/category?