Theme modification

Theme modification

by Justin Darlet -
Number of replies: 2

Hi everyone,

I try to create a list of color sets to change theme colors. I got a list, I choose a set and the theme colors has changed. It works but I needed to do a require of a file that contains the list in the file lib.php in my theme folder. Is it wrong to add a dependency in lib.php ?

I tried to add my list in the setting.php file (screen 1 and 2) and use it in lib.php (there is require with this way, screen 3), but it doesn't work... In my opinion, it would still be the best solution. Any ideas?

Thank you in advance,

Justin.

Attachment Capture1.PNG
Attachment Capture2.PNG
Attachment Capture3.PNG
Average of ratings: -
In reply to Justin Darlet

Re: Theme modification

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi Justin,

You could always dig through the no longer supported Formal White theme and see how they used "trend color" sets in it. It included 7 different color combinations.

Formal White can still be downloaded here: https://moodle.org/plugins/theme_formal_white

You don't mention which version of Moodle you use, but  even though Formal White has not been updated since version 2.7 it still "mostly" works in later versions of Moodle. I always liked it due to it's fixed width block columns. The new grading interface in Moodle 3.1 doesn't render with it, so because of that and two other problems, I guess I'm going to have to finally give up on it.

In reply to AL Rachels

Re: Theme modification

by Justin Darlet -

Hi,

Thank you for your answer AL, I use Moodle 3.0.3.

I finally decided to keep the "require" way, because it's impossible to put 2D array in setting.php (it try to convert the array on string) and it's easier. I'll try to put my array on a JSON file and read it with PHP to remove the require.