Standard Theme

Standard Theme

by Deborah Delin -
Number of replies: 11

Hi there,

Before Mary pointed out that I shouldn't be doing this, I altered my Standard theme.  Now I am trying to untangle the mess and I need to put the code in Standard theme back to what it was.  But Standard theme isn't available in the Themes Repository as it is available on all Moodle installations.  (Yes, well, they didn't take into account blundering novices like me!blush). 

I have narrowed the problem down to being in styles_color.css, in this bit of code:

body {
background-image:url(body.gif);
color:#1617a1;

}

#page {
 width:990px;
 margin:0px auto;
   background: url(body.gif);

I wonder if someone could kindly post this piece of code in its unaltered state or direct me to where I can find it.

Thanks so much.

Deborah

Average of ratings: -
In reply to Deborah Delin

Re: Standard Theme

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Why don't you just download a fresh copy of Moodle 1.9.x, and get the standard theme out of there.

Or, browse it online at http://cvs.moodle.org/moodle/theme/standard/styles_color.css?view=markup&pathrev=MOODLE_19_STABLE
In reply to Tim Hunt

Re: Standard Theme

by Deborah Delin -
I didn't think of that! Thank you so much Tim and Mary. Just what I needed.

Deborah
In reply to Tim Hunt

Re: Standard Theme

by Deborah Delin -

Hi Mary!

Yes, I see that I was confusing things mentioning both the body and the page code. Sorry! The theme now functions fine with the body bit in the Standard theme back to what it should be.  But if I take out the bit about page, which shouldn't be in the Standard file, the theme misfunctions.

In the config.php file of the theme I modified (I used Wood because it is fixed width), the line you mention:

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

doesn't appear.  The nearest is:

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

but when I deleted 'styles_fonts', 'styles_color' as you suggested I got even more white background in my theme. 

Rather than drive you crazy over this small point I am thinking I will just leave that extra bit of #page code in the standard file.  True it would colour any future themes wrongly, but I am not planning on creating any more Moodles at the moment.........  Is there any other problem with leaving it like that?

Thanks so much for your patience.

Deborah

In reply to Deborah Delin

Re: Standard Theme

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
OK...never mind about that. I think I found why your CSS wasn't working. You had 2 PARSE ERRORS in style_color.css

This means you had missed off some important element of CSS which basically rendered the whole of the CSS file useless.

As it happens, it was the closing curly bracket missing at the end of this these lines

#page {
width:990px;
margin:0px auto;
background: url(body.gif); }

The 2nd error was the next line of code down from the previous Error here...

th.header,
td.header,
div.header { border-color:#FFFFFF; url(header.gif) repeat-y; }

but should have read like this...

th.header,
td.header,
div.header { border-color:#FFFFFF; background: url(header.gif) repeat-y;}

If you were wondering why the header image wasn't working that's the reason why!

To see the image CLICK HERE

OK..to save you time I've uploaded the corrected CSS file, which I copied from your website a few mins ago, put it through the CSS Validator, fixed the errors and uploaded it here for you to put back into your theme folder.

Before you do this though, please rename your current CSS from styles_color.css to old_styles_color.css that way you have a copy to see where you went wrong.

Hope this fixes the problem. Also you need to take out the image from your standard theme css so that you can see if it is working from your own css file. OK?

Mary

In reply to Mary Evans

Re: Standard Theme

by Deborah Delin -

My goodness Mary - you are an angel and a magician!  I can't believe you went to all that trouble!   Thank you SO much!!

It is all working perfectly now, with the Standard file back to Standard and no body image in it.big grin  

I vow to check myself 23 times in future when I meddle with code!

Thank you ............

Deborah

In reply to Deborah Delin

Re: Standard Theme

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
It was a pleasure! Actually I learnt quite a lot in all of this, as each person's view is different, so too is the way we all approach customising a theme. It's not easy, but worth the struggle I always think when we see the finished product of our labours.

Thank goodness for the W3C CSS Validator. It is such a useful tool as it can pick up where all the mistakes are in a given css file. And when it's right you get a certificate to put on your site!

And lastly, I'd like to congratulate you, Deborah, because you stuck with this theme and got it to work. (with a little help from your Moodle friends!)

Take care,

Mary
In reply to Deborah Delin

Re: Standard Theme

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
See attached styles_color.css

Mary
In reply to Mary Evans

Re: Standard Theme

by Deborah Delin -
Hello,

I originally put the following code in Standard>styles_color.css:

#page {
width:990px;
margin:0px auto;
background: url(body.gif);

Now I want to return my Standard theme to it's original form. I also have the above piece of code in the styles_color.css file of the modified theme I am using. But when I take this code out of the Standard file, parts of the background of my theme (background to blocks and signup form) come out white.

How can I get my theme to fully "take notice" of the styles_color.css in my theme folder without reverting to the Standard theme?

Many thanks in advance.

Deborah



In reply to Deborah Delin

Re: Standard Theme

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

As I remember it you had the body.gif in the body of your css file too. Which is right at the top of styles_color.

It's also in the code you posed at the top of this thread! smile

So just add this line to your theme's css file...


body { background-image: url(body.gif) }

Mary
In reply to Mary Evans

Re: Standard Theme

by Deborah Delin -

Mary thanks for trying to help! 

Sorry, either I didn't make my problem clear, or I am not understanding your answer.

When you say add this line to your theme's css file:

body { background-image: url(body.gif) }

do you mean to styles_color.css?  Or is there another css file I need to put it in?  Because it is already in the styles_color.css file but for some reason Moodle only seems to take partial notice of it - and I get the white background effect which I don't get when it is in the style_color.css file of the Standard theme.thoughtful

Thanks for your patience.

Deborah

In reply to Deborah Delin

Re: Standard Theme

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

You wrote this at the top of this thread...

I have narrowed the problem down to being in styles_color.css, in this bit of code:

body {
background-image:url(body.gif);
color:#1617a1;

}

#page {
width:990px;
margin:0px auto;
background: url(body.gif);

Then in your last but one post you mentioned only one of the above...this one

#page {
width:990px;
margin:0px auto;
background: url(body.gif);

As both (body & #page) CSS selectors (as they are called) have the body.gif in the code my point, in my last post, was that you need to add the body code too. I had assumed that you had not included that in your theme's CSS file.

Now it's here that I am getting confused!!! LOL

You could stop the way standard theme keeps over riding your theme, by only declaring styles_layout in the config.php of your theme.

This is the line I am talking about in your theme's config.php

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

Delete those items higlighted so that it looks like this...see below
This will ensure that only styles_layout will be used if needed. This is good as it keeps the structure of the layout-table as it should be.

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


I hope this all helps! smile

Mary