Not able to create custom theme

Not able to create custom theme

Greg Thomas發表於
Number of replies: 5
hi
have installed Moodle 1.9.4 on Ubuntu 8.10 and am trying to design a custom theme. I have http://docs.moodle.org/en/Creating_a_custom_theme and Julian's Youtube videos as a guide since am new to coding.
I copied the Standard Theme into another folder, renamed it and imported it within Moodle. Modified config.php file and styles_color.css. When I change the page background color and the regular link color, it doesnt reflect on the site. Any reason why this could be happening. I havent reached the advanced theming stage yet.
評比平均分數: -
In reply to Greg Thomas

Re: Not able to create custom theme

Mauno Korpelainen發表於

Can you see your new theme in Theme selector and did you change your theme from

Administration > Appearance > Themes > Theme selector ?

Sometimes when you upload new css files to your site you may also need to refresh page/browser or clear cache...

In reply to Mauno Korpelainen

Re: Not able to create custom theme

Greg Thomas發表於
yes, have selected my theme from same location. Even restarted my PC to make sure it isn't cache problem
Here's my config.php file lying in mynewtheme folder edited as per instructions

$THEME->sheets = array('user_styles');
$THEME->standardsheets = array('styles_layout');
$THEME->parent = 'custom_corners'; //mynewtheme
$THEME->parentsheets = array('user_styles');
$THEME->modsheets = true;
$THEME->blocksheets = true;
$THEME->langsheets = false;
$THEME->courseformatsheets = true;
$THEME->metainclude = false;
$THEME->standardmetainclude = true;
$THEME->parentmetainclude = false;
$THEME->navmenuwidth = 50;
$THEME->makenavmenulist = false;
$THEME->resource_mp3player_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'font=Arial&fontColour=3333FF&buffer=10&waitForPlay=no&autoPlay=yes';
$THEME->filter_mediaplugin_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'waitForPlay=yes';
$THEME->custompix = false;



In reply to Greg Thomas

Re: Not able to create custom theme

Mauno Korpelainen發表於

OK -this explains your case - you modified file styles_color.css but your theme config.php has

$THEME->sheets = array('user_styles');


meaning that user_styles.css should contain your changes or you should add styles_color.css to that array.

Or you could edit parent theme custom_corners user_styles.css or standard theme styles_layout.css - other css files have no influence. The last tags in your custom theme user_styles.css override previous ones in parent theme and standard theme

In reply to Mauno Korpelainen

Re: Not able to create custom theme

Greg Thomas發表於
I was only following the instructions written in http://docs.moodle.org/en/Creating_a_custom_theme. It says

Use code like this this in /theme/yourtheme/config.php

$THEME->sheets = array('user_styles');
$THEME->standardsheets = array('styles_layout');
$THEME->parent = 'custom_corners'; // put the name of the theme folder you want to use as parent here. 
$THEME->parentsheets = array('user_styles');
Should I reverse the changes made to the config.php in my newtheme folder which is a copy of Standard Theme folder. The config.php earlier contained the following
$THEME->sheets = array('styles_layout', 'styles_fonts', 'styles_color');
$THEME->standardsheets = true;
$THEME->parent = '';
$THEME->parentsheets = false;


In reply to Greg Thomas

Re: Not able to create custom theme

Mauno Korpelainen發表於

It depends on the files you want to use. If your theme folder has styles_layout.css and it has different css tags than standard theme styles_layout.css you need to have in your custom theme config.php at least

$THEME->sheets = array('styles_layout');

and if you want to change all those css files you can as well use

$THEME->sheets = array('styles_layout', 'styles_fonts', 'styles_color');

But then you don't need to load the same css twice and can as well set $THEME->standardsheets = false;.

Usually people leave $THEME->standardsheets = true; and add only those tags they want to change to custom theme css file(s) that are defined in $THEME->sheets array.

Yes, if you have a nice parent theme like custom_corners you can set

$THEME->parent = 'custom_corners';

and if you don't need it you can as well leave $THEME->parent=''; and $THEME->parentsheets = false;

The basic idea is explained in http://docs.moodle.org/en/Theme_basics#The_standard_theme