creating image based themes

creating image based themes

- David Barnett の投稿
返信数: 8
What would be the best way to go about creating image based themes as opposed to just the standard colour options. I like the look of the color options but am curious about how it could be best done with images.

For example adding generic 'course banners' in the header, and graphical navigation areas to replace the existing text ones in the body of the page. (people, activities, etc.)

does anybody have any suggestions?

cheers,
Dave


David Barnett への返信

Re: creating image based themes

- Martin Dougiamas の投稿
画像 Core developers 画像 Documentation writers 画像 Moodle HQ 画像 Particularly helpful Moodlers 画像 Plugin developers 画像 Testers
Header graphics would be relatively easy, just edit the header.html file and work it in around the PHP code. I know it's not as tidy in there as it could be ... the same header file controls the top of ALL moodle pages so there is some logic involved. Suggestions for making it easier welcomed. Still, shouldn't be too hard.

As for graphical navigation, er, no. You might be able to go some way towards a prettier look using the style sheet (eg graphical backgrounds on tables) but there's not very fine-grained control yet. Eventually there will be, though: http://bugs.moodle.com/bug.php?op=show&bugid=25

Actual graphical buttons are right out, unless you want to do some major hacking. Much more trouble than they're worth.

Cheers!
Martin
David Barnett への返信

Re: creating image based themes

- Alan Chambers の投稿

To create a background image for your Moodle website

In the file /themes/standard/header.html replace the body tag code (approx. line 11) with

<BODY <? if ($focus) { echo "setfocus()"; } echo " background=\"$THEME->background\" bgProperties=fixed>"; ?>

This gives a fixed background when the page is scrolled, which seems better than a normal background.

In the file /themes/standard/config.php add a variable

$THEME->background = "image.gif"; // Main page background image

All that remains to be done is to add the image.gif file to each of the directories/folders throughout Moodle.

Alan Chambers への返信

Re: creating image based themes

- Martin Dougiamas の投稿
画像 Core developers 画像 Documentation writers 画像 Moodle HQ 画像 Particularly helpful Moodlers 画像 Plugin developers 画像 Testers
Thanks for posting, but that's not the best way to do it!

No need to put image.gif in every folder, and no need to create a new THEME variable!

Just put the image in your theme folder, then alter header.html as follows:

<BODY <? if ($focus) {echo "setfocus()"; } echo " background="$CFG->wwwroot/theme/mytheme/background.gif" bgProperties=fixed>"; ?>
Also, I'd recommend not altering the standard theme, but copying the "standard" directory to a new directory with your own name (eg mytheme), then editing that.

This will all be even easier in 1.0.7 when full CSS support is added.

Cheers,
Martin
Martin Dougiamas への返信

designer logo for moodle

- Michael Henley の投稿

Martin,

I am one of Alan Chambers IT VET students and I have designed a logo for your moodle site as a contribution to your efforts. We students at Duval are making good use of your impressive software.

 

添付 moodle_header.png
Michael Henley への返信

Re: designer logo for moodle

- Martin Dougiamas の投稿
画像 Core developers 画像 Documentation writers 画像 Moodle HQ 画像 Particularly helpful Moodlers 画像 Plugin developers 画像 Testers
Many thanks, Michael. I'll put it on the front page for a day or so.

If you feel like making some more stuff, what might be good is a cool matching set of little icons (forums, resources etc). 笑顔
Martin Dougiamas への返信

Re: designer logo for moodle

- Fabio Serenelli の投稿

...and what about using other openspurce CMS icons? like phpnuke or postnuke icons?

there a lot of free images in their communities... a lot of nice stuff and very well done!

Eh?! faBIO

Martin Dougiamas への返信

Re: creating image based themes

- Charil Ferrell の投稿

Martin,

After looking around to find the best way use the same settings in standardred with the exception in that I desire to put in my own background (bckgrnd7.jpg) I found this post, and so I thought I would give your suggestion a try. 

<BODY <? if ($focus) {echo "setfocus()"; } echo " background="$CFG->wwwroot/theme/mytheme/bckgrnd7.GIF" bgProperties=fixed>"; ?>

This is the result: 

Parse error: parse error, expecting `','' or `';'' in /home/lwbinet/public_html/moodle1/theme/mytheme/header.html on line 11.

I tried the change in format from .JPG to .GIF.  with the same result.  Any help would be appreciated.

Thank you in advance for any advise/suggestions.

Kaujoi

Charil Ferrell への返信

Re: creating image based themes

- Lawrence Khoo の投稿
That code has a couple of bugs in it, try using this one instead.

<body<?php
if ($focus) { echo " onload = setfocus()"; }
echo " background=\"$CFG->wwwroot/theme/$CFG->theme/top.jpg\" >" ;
?>