How do you edit the body layout?

How do you edit the body layout?

by Keith Bennett -
Number of replies: 10

How do you edit what comes out in html between the header and footer?  For example, I'd like my page to output the html

<th>Site news</th>

instead of:
<td>Site news</td>

On the main page in the center column?

Average of ratings: -
In reply to Keith Bennett

Re: How do you edit the body layout?

by Andrea Bicciolo -

Hi Keith,

you could modify the styles.php file of your theme. Search for .headingblock CSS2 class definition and modify accordingly to your needs.

In reply to Keith Bennett

Re: How do you edit the body layout?

by Andreas Weber -
If you want to edit the HTML tags you need to go
into the php files e.g. index.php.

In the future (maybe in moodle v2) php and HTML
code will be on different places.
In reply to Andreas Weber

Re: How do you edit the body layout?

by Steve Adcock -

Another more flexible way is to create a little php script in its own file that defines what you want and include it to replace what you want changed. eg: You might define your own data such as your news table as a php string and then include that string variable onto your page. Its probably better than trying to alter the current code to suit your needs as it often is combined with other things on the page. Sorry if this sounds like hard work but its actually easier than trying to fiddle with the current code. Just look how simple the config.php page is that is included and defining a table as one php string would be much simpler than that.

Just a suggestion.

In reply to Steve Adcock

Re: How do you edit the body layout?

by Keith Bennett -

Thanks all.

What I decided to do for now is just put "available courses" on the front page instead of "site news". For some reason I can change the look of th but I can't change the look of .headingblock or .headingblockcontent from my css file. I Don't know why. Just can't. So rather than keep fighting the code I just did that workaround.

Here's what I worked out:

<http://eflplanet.com/guild/>;

The real problem I had was the classes with dark blue background- I couldn't get the links on a dark blue background to be a different color than the regular links.

 

In reply to Keith Bennett

Re: How do you edit the body layout?

by Bryan Williams -

Link at bottom points to Moodle.com instead of Moodle.org.  Nice job, site looks very cool! cool

In reply to Keith Bennett

Re: How do you edit the body layout?

by David Le Blanc -

I don't know what colour you want your links to be on the dark blue header background. You can try adding or replacing the following lines into your styles.php file within the theme sub folder where you have your theme.

.headingblock a:link {    color: #FFFF66;}
.headingblock a:visited {    color: #FFFF66;}
.headingblock a:hover {    text-decoration: underline;    color: #FFFF66;} 

David Le Blanc

http://MySandbox.net

http://MySandbox.net/courses/

In reply to David Le Blanc

Re: How do you edit the body layout?

by Keith Bennett -

This is really weird.  I don't know what's different about today, but everything works fine now.  I can control the look of .headingblock today but yesterday I couldn't.  Same file but different day.

Could this have anything to do with the fact that my cron was set to the wrong file?

Well, anyway I'm glad it's working now but I'm at a complete loss as to how or why it wasn't working before.

Thanks for the color tip.

 Yellow on Dark Bule makes a nice contrast and maybe I'll re-think my color scheme.

In reply to Keith Bennett

Re: How do you edit the body layout?

by Abdul Rafi Jaffarullah -

How did you add those dynamic logo on http://www.eflplanet.com/guild/ page.??

In which file i should make the changes??

RAFI.

In reply to Abdul Rafi Jaffarullah

Re: How do you edit the body layout?

by Keith Bennett -

Edit theme/yourtheme/header.html

All you've got to do is add HTML where you want it.  I put my site's stuff in a table that gets printed out before the moodle stuff. I added it twice, just after: 

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

and

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

because I want my site info both on the home page and on "navigation" pages, but not on pages like the popup help windows. 

so anyway, just put an image link in there where you want it.

My logo is really three images together.  The firts one is a rotating globe, the second one is a normal gif with text, then another .gif of the guru.

What I'd really like to do is have a different 3rd gif for each type of course (or perhaps different modules), but I'll put that off until I know more about moodle.

I also did this to put the "loggedinas" in the header instead of the footer:

http://moodle.org/mod/forum/discuss.php?d=452#2183

In reply to Keith Bennett

Re: How do you edit the body layout?

by Ger Tielemans -

I was wondering...

  1. Is it possible to make a clone of a course format and then "overrule" the theme-layout? (That way every teacher could choose his own looks..)
  2. Is there a list of all these conditions you can check (and their scope?)
    like if ($home) {}.... if ($navigation) {}