disabling color changer in Splash

disabling color changer in Splash

by Gilles Gagnon -
Number of replies: 15

In the theme Splash, there is a colour changer in the top right. Is there an easy way via an interface to disable this? or must I change the php files of the theme?

Gilles

Average of ratings: -
In reply to Gilles Gagnon

Re: disabling color changer in Splash

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

I believe you would have to do it through the theme files. There should be no need to get rid of it completely and dig deep into the php that uses that to set the colours.

in the styles folder of the theme, in sl.css find the #colourswitcher section and add the line display:none; to the css rules.

 

Richard

In reply to Gilles Gagnon

Re: disabling color changer in Splash

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

A further very quick look at the Splash theme settings page (from the admin appearance theme settings menu) shows that the author of the theme has provided a custom css section which will be applied to every page.

Simply adding #colourswitcher{display:none;} to this section has the same effect without going into the theme files at all.

Richard

In reply to Richard Oelmann

Re: disabling color changer in Splash

by Gilles Gagnon -

Hi Richard and Mary,

I just added the rule in the Custom CSS entry box and it made no difference. The switcher still appears in the top right.

Any ideas?

Gilles

In reply to Gilles Gagnon

Re: disabling color changer in Splash

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Make sure you have cleared the cache.

I've tested it and adding the line I suggested definitely works on my install.

Richard

In reply to Gilles Gagnon

Re: disabling color changer in Splash

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Gilles,

What Richard advised is spot on. However, should you wish to change the same unordered list which the colourswitcher uses, you will find the HTML code in general.php...and here it is as a guide...you could make it into a site navigation block utilising the <ul></ul>and <li></li> tags. As for changing PHP files...I think you will find the colourswitcher worked by JavaScript which is in the YUI folder of the theme.

<div id="colourswitcher">
<ul>
<li><img src="<?php echo $OUTPUT->pix_url('colour', 'theme'); ?>" alt="colour" /></li>
<li><a href="<?php echo new moodle_url($PAGE->url, array('splashcolour'=>'red')); ?>" class="styleswitch colour-red"><img src="<?php echo $OUTPUT->pix_url('red-theme2', 'theme'); ?>" alt="red" /></a></li>
<li><a href="<?php echo new moodle_url($PAGE->url, array('splashcolour'=>'green')); ?>" class="styleswitch colour-green"><img src="<?php echo $OUTPUT->pix_url('green-theme2', 'theme'); ?>" alt="green" /></a></li>
<li><a href="<?php echo new moodle_url($PAGE->url, array('splashcolour'=>'blue')); ?>" class="styleswitch colour-blue"><img src="<?php echo $OUTPUT->pix_url('blue-theme2', 'theme'); ?>" alt="blue" /></a></li>
<li><a href="<?php echo new moodle_url($PAGE->url, array('splashcolour'=>'orange')); ?>" class="styleswitch colour-orange"><img src="<?php echo $OUTPUT->pix_url('orange-theme2', 'theme'); ?>" alt="orange" /></a></li>
</ul>
</div>

Mary

In reply to Mary Evans

Re: disabling color changer in Splash

by Gilles Gagnon -

thanks to you both! this is fantastic!

Now how do I set the theme to have the "blue" them as a default, instead of red, before I remove the color switcher?

Gilles

In reply to Gilles Gagnon

Re: disabling color changer in Splash

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

I would imagine that would be the easiest thing to figure out!

I think you can do that...just imageing there is only one css stylesheet and not four.

Given that the JS is disabled by deleting it from the theme folder completely. Then delete the colourswitcher code from the general.php file. All you will need to do then is delete the red, green and orange css stylesheets from the theme folder. What could be easier!

There won't be much left of the theme as far as I can see. It would have been easier to have just copied the theme then replace the main css file with the blue color css code, thus replacing the red.

 

 

In reply to Mary Evans

Re: disabling color changer in Splash

by Gilles Gagnon -

Thanks Mary,

I can certainly mod the code. i was trying to accomplish this without changing the template code. WIth Joomla, you often have an interface for the template options. This way, if you update the template, you don't lose settings. I was hoping to accomplish all this in a similar manner.

Gilles

In reply to Mary Evans

Re: disabling color changer in Splash

by Gilles Gagnon -

Hi Mary,

I have disabled the color switcher, thanks for your help.

WHat is the correct way of telling moodle the default color of my splash theme?

I have it somewhat working but not quite.  I want it to use the blue theme.  I've changed some jpgs but when I'm not logged in, the bg image is still taken from the orange(red) color set. How to I tell it to use the blue set by default?

Thanks,

Gilles

In reply to Gilles Gagnon

Re: disabling color changer in Splash

by Suranga Jayasena -

Hi Mary and Richard,

Thanks Mary and Chris for clear guidance. I also wanted blue to be default and could do it following your guidance. However, in my case I didn’t want to hide the colour swatch.

The next task: if I have four different logo images for respective colour schemes placed in theme’s pix folder, how can I make them to change with selected colour? Shall we continue it here or should this go as a new thread? Sorry, I am new to Moodle.

 

Gilles,

You need to replace all corresponding colour codes and image reference in sl.css to that you find in blue.css. There is no need to change other codes (including colour codes if not found in blue.css). I did this and have successful results. I went further to change all such codes in blue.css to those of sl.css. Now my default scheme is blue. When I click on “red” colour switch I get blue, and when clicked on “blue” I get red scheme. So that had to solved. I swapped image source and the “alt” text under <div id="colourswitcher"> in general.php. Trick worked.

I’m sorry I can’t attach the modified files here, IE7 tries to download “repository_ajax.php” file instead of uploading my file. Any alternative?

Edited: oops, it looks like the attachement is upload despite the error. Good, Gilles you can have it.

Backup your original files first and overwrite with attached files. Do remember to purge the cache after replacing. Note that I have not hidden the colour swatch.

In reply to Suranga Jayasena

Re: disabling color changer in Splash

by Suranga Jayasena -

Hi,

I started a new post for my question about logo change here.

Thanks.

Suranga

In reply to Gilles Gagnon

Re: disabling color changer in Splash

by Bob Singletary -

While I did keep the theme switcher enabled, I found that by changing the color value in the following line in lib.php (in the moodle/theme/splash folder):

function splash_get_colour($default='red')    {

For example change it to blue or whichever of the other three colors you prefer as the default. Seems to work just fine.

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

Re: disabling color changer in Splash.

by Eduardo Ortega -

I have followed the indications of Mary to disable the colourswitcher and I have good results, but when I go to reports and then comments then the colourswitcher appears again in this area if I go back to the main page the colourswitcher dissapears again.
Thanks for any help and regards,
Eduardo Ortega

In reply to Eduardo Ortega

Re: disabling color changer in Splash.

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi you also need to remove the code from the report.php too...that is assuming you removed the code for general.php?

Cheers

Mary