How to customize the main page.

How to customize the main page.

by Anthony Eufemio -
Number of replies: 17

Are there any tips on how to customize the main/intro page?  I want to be able to change the font color as well as the table background for the course list on the main page. 

Thanks

Average of ratings: -
In reply to Anthony Eufemio

Re: How to customize the main page.

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
You need to use CSS - modify the styles.php file in your current theme (or copy one of the standard themes in theme/xxxx to your own folder and modify that).

If someone wants to write documentation for theme editing I'd be grateful!
In reply to Martin Dougiamas

Re: How to customize the main page.

by Anthony Eufemio -

Martin,

How do I change the font color in the main page?  It seems like it always retains the black font and there's a table with white background even after editing config.php and styles.php.  I'm trying to create a dark background theme with light colored fonts. 

Check out http://www.ritual-magic.com/cybertemple with login: test password: test123.  I want to change the background color of the table cell that contains the summary for the Probationer course as well as the font color.

Thanks!

-Anthony Eufemio

In reply to Martin Dougiamas

Re: How to customize the main page.

by Charil Ferrell -

Martin,

I am currently re-writing the styles.php for a new theme, I should be done within another day.  I will glady submit not only my new theme for all to use, but also a downloadable version with tags for easy use for others.

Kaujoi

In reply to Charil Ferrell

Re: How to customize the main page.

by gregg lymbery -

Charil,

Following the thread and saw your post. I'm trying - unsuccessfully - to change the theme for a local school, but am not familiar with PHP. Did you complete your theme? and is it in a form I can look at to modify to get the local school colurs & logo instead of the usual 'sand yellow'?

In reply to gregg lymbery

Re: How to customize the main page.

by Jeffery Watkins -

If you would like, I would be happy to fix your theme for you.  While I do, I can write out some documentation in a step by step like manner.  Although, with the coming changes in themeing for Moodle, do we still need a theme guide?

Jeff Watkins

In reply to Martin Dougiamas

Re: How to customize the main page.

by Russell Birchall -
I have a new install via Fantastico and would "just" like to replace the title "ABC School" at the top of the page with a banner. I only have a passing knowledge of php, but the title appears to be stored somewhere in a varaible called $heading or $header. I've seen other pages that have done this but the source appears to be generated dynamically so I can't find the original code.
Question: Where can I go to change the value of this variable so that it points to a graphic?
Thanks!
In reply to Russell Birchall

Re: How to customize the main page.

by John Gone -
You'll need to make changes to header.html and you'll find this file in your current theme
Moodle -> yourtheme -> header.html

The changes will be made in the following area: (this code from standardlogo)
simply replace "logo.jpg" with the necessary name

<?php if ($home) { // This is what gets printed on the home page only ?>

<table width="100%" cellpadding="10" cellspacing="0" border="0" class="headerhome">
<tr>
<td valign="top" class="headerhomemain"><img
border="0" src="<?php echo "$CFG->wwwroot/theme/$CFG->theme/logo.jpg" ?>"></td>
<td align="right" valign="top" class="headerhomemenu"><?php echo $menu ?></td>
</tr>
</table>

<?php } else if ($heading) { // This is what gets printed on any other page with a heading ?>

<table width="100%" cellpadding="0" cellspacing="0" border="0" class="header">
<tr>
<td valign="top" class="headermain"><?php echo $heading?></td>
<td align="right" valign="top" class="headermenu"><?php echo $menu ?></td>
</tr>
</table>

<?php } ?>
In reply to John Gone

Re: How to customize the main page.

by John McMurray -

John you seem to know a lot about theme customisation.

I an new to Moodle but learning fast.
I would like to get some code that enables me to place a background image onto all the pages on my site.
I have manage to put it into the index page but as I am using 1.2, the main 'window' frame sits on top and obscures it! It is in this main 'floating' window frame where I would like the background image - most importantly on the main page but ideally throughout.

We are a training college in Australia and our site is now 'live'

www.gcitonline.qld.edu.au/moodle/

any help would be appreciated

John

In reply to John McMurray

Re: How to customize the main page.

by John Gone -
Put the background image in:
http://gcitonline.qld.edu.au/moodle/theme/cornflower/styles.php


and then add this line to the body class of your style.php
body, td, th, li {
font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
background-image: url(<?PHP echo "$themeurl"?>/Website-background1024x550.jpg);
}
In reply to John Gone

Re: How to customize the main page.

by John McMurray -

Thanks John that did work but it created a couple of problems.

It appears that the 'floating' window is made up of several 'frames' and my image appeared in 'each one' or at least a bit of the image in each one.

Is it possible to make the 'floating' window transparent? If so, how? That way I can make the index page (at the back) hold the image then it will simply 'show through'.

John

In reply to John McMurray

Re: How to customize the main page.

by Jeffery Watkins -

John,

Cornflower is one of the themes I created.  If you want to change the background of the "floating window" here is what you have to do:

In Header.html  look for this line, for me it starts at Line 12,

<body bgcolor="#006699">
<table align="center" width="100%" border="1" cellpadding="5" bgcolor="#739fc4" <?php
   if ($focus) {
       echo " Xonload=setfocus()";
   }
?>>

And change to this:

<body bgcolor="#006699">
<table align="center" width="100%" border="1" cellpadding="5" background="<?php echo "$CFG->wwwroot/theme/$CFG->theme/background.gif" ?>"  <?php
   if ($focus) {
       echo " Xonload=setfocus()";
   }
?>>

the background image must be in your theme directory.  I have included an exapmle screen shot.  All of the little boxes should probably remain the way they are for appearance and ease of use.  The background I use is just some lines.... you could use anything.

If you want some help sorting this out, send me the theme folder and your background picture and such, and I will be happy to customise it for your school.

Jeff Watkins

jwatkins@classroomrevolution.com

PS. I know that background in the example does not match the page... just an examplewink

Attachment example.jpg
In reply to Jeffery Watkins

Re: How to customize the main page.

by Tom Murdock -
Hey Jeff,

Just for clarification, I know you taught me how to do the framing and I know I'd borrowed one of your blue themes, but I thought I'd constructed cornflower out of colors I'd liked on http://www.bbc.co.uk/.

Still, for the stuff I'd learned from you, I'd be fine if Martin credited you for the theme rather than me.

-Tom
In reply to Tom Murdock

Re: How to customize the main page.

by Jeffery Watkins -

Yeah Tom, I guess your right.  There are some different colors in cornflower than the theme I originally posted.  I will edit my message.

Jeff Watkins

Couldn't edit my orignal, please disregard it.

Attachment notthemsame.jpg
In reply to Jeffery Watkins

Re: How to customize the main page.

by Tom Murdock -
No, no, no! Two colors.... hardly an original on my part! Sorry I forgot the origins of it. Martin had spied it on my site and wondered if he could use it. I think you should have the credit. I would just recommend that we update the borders to be black. It looks better than the white, I think!
In reply to Jeffery Watkins

OTP Re: How to customize the main page.

by Ray Lawrence -

The Cornflower theme is a favourite of mine. Many thanks - to whichever of you wants the credit. smile

In reply to Jeffery Watkins

Re: How to customize the main page.

by Donici Catalin Sergiu -

What is the code of the color in the picture? i whant to use it and i can't find it.

thanks.

Attachment Capture.GIF