customizing boxxie theme

Re: customizing boxxie theme

by Richard Oelmann -
Number of replies: 12
Picture of Core developers Picture of Plugin developers Picture of Testers

OK.

There are several ways to achieve this - but all of them start with either cloning the original theme, or creating a new theme with boxxie as a parent. This is always good practice when making changes to core themes.

Attached to this post is a new theme for you called minimal and for reference below are the steps I used to create it and how you can develop it further.

  1. I opted to create a new theme using boxxie as a parent.
    1. Create a folder called minimal
    2. Add a file called config.php into which I copied the config.php from boxxie.
    3. Edit the minimal/config.php to change the theme name, add boxxie as a parent (canvas and base are already parents for boxxie so leave those there). I also changed the name of the css sheet I was going to use to minimal and specified that all the layout files should be read from boxxie - I think in fact you could get rid of these completely as it would read the layout files from the parent anyway. I have chosen to leave them there in case future development of the minimal theme involves creating its own layout files.
    4. Add a folder called style and inside that a file called minimal.css - this will hold all our css changes to the main theme
    5. Copy the lang folder and contents from boxxie and rename the /lang/en/theme_boxxie.php as theme_minimal.php
    6. Edit the theme_minimal.php file to change the theme name. I also altered the choosereadme section to reflect the theme itself.
  2. Create the background images needed - I did this using GIMP and created 2 thin images which would be repeated across the width of the screen
  3. Create a folder in the minimal theme called /pix and save the images created in that folder
  4. Edit the /style/minimal.css sheet to add the css rules needed for the elements (in this case for the OP here, a gradient background image for the header and for the block header)

The theme structure should look like:

  • minimal (folder)
    • lang (folder)
      • theme_minimal.php
    • pix (folder)
      • headerbg.png
      • blockheaderbg.png
    • style (folder)
      • minimal.css
    • config.php (file)

This can be adapted to create a theme based on any core theme as a parent - simply change the references to the parent themes in the config.php file as needed. Oh - and if you are changing the name of this theme then don't forget to rename the theme (folder, config.php, theme_yourtheme.php - rename and change the plugin name inside the file)

 

To make any other changes to the appearance of the parent (Boxxie), they can then be made by changing the css rules in the minimal.css style sheet in this theme and not in the core theme itself.

To change the look of the gradients provided - edit the images themselves in any good graphics package and resave them in the same location with the same name.

 

I hope that helps you and many others starting out on editing your themes smile

Richard

 

PS. there are other ways to achieve the gradient effect, such as CSS3 - but as that is not recognised by older versions of IE (I think 9 recognises gradients, I'm not sure about 8 and earlier) I have stuck to using the tried and tested background image method for you - feel free to use whatever methods you prefer in your finished theme however!

                        

In reply to Richard Oelmann

Re: customizing boxxie theme

by amine bendahou -

thank you

In reply to amine bendahou

Re: customizing boxxie theme

by amine bendahou -

i made another gradient with openoffice draw however it doesn't fit the whole background, some space remain empty

what do you suggest

In reply to amine bendahou

Re: customizing boxxie theme

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

The gradient I put in the minimal theme for you was a narrow (1px wide) image which automatically repeats across the whole screen. This is usually the best way of achieving something like this as it automatically copes with different screen widths.

If you take a look a the css file it will show you how the image is repeated

#page-header {
    background-color: #0f0;
    background-image: url([[pix:theme|headerbg]]);
    background-position: left top;
    background-repeat: repeat-x;
    height:150px;
}

 

Richard

In reply to Richard Oelmann

Re: customizing boxxie theme

by amine bendahou -

i got an error today saying

 

Config table does not contain version, can not continue, sorry

oding error detected, it must be fixed by a programmer: block_manager has not yet loaded the blocks, to it is too soon to request the information you asked for.

 

any idea??

In reply to amine bendahou

Re: customizing boxxie theme

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Where have you uploaded the theme to Amine? It sounds like you have put it into the blocks or modules folder instead of the theme folder?

In reply to Richard Oelmann

Re: customizing boxxie theme

by amine bendahou -

i uploaded it to themes and it was working yesterday

i deleted the block directory and reupload it again

same issue

In reply to amine bendahou

Re: customizing boxxie theme

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Deleted the block directory??? Likely to be the cause of the messages about the block manager etc. mixed

In reply to Richard Oelmann

Re: customizing boxxie theme

by amine bendahou -

i delted the block directory (maybe corrupted) and reupload it again from the moodle folder to see if the issue is solved

so i'm gonna reinstall moodle

 

thanks anyway

In reply to Richard Oelmann

Re: customizing boxxie theme

by John Pull -

I've successfully installed the Minimal theme, and successfully selected it from the Theme Selector.  However, there's one problem:

The new theme doesn't show up in the left rail under:

Settings > Site Administration > Appearance > Themes

Because it's not there, I can't use any of the Admin Panel theme controls, such as "Custom Logo" or "Custom Front Page Logo."

Any advice?  BTW, thanks for this great how-to.

In reply to John Pull

Re: customizing boxxie theme

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

Hi that is because that list is a list of themes which have custom settings pages. If you wanted a theme that adds a custom logo or any other customisation, you would need to 'clone' one of those themes. There is an advanced Tutorial which explains how to clone the Afterburner theme.

HTH

Mary

In reply to John Pull

Re: customizing boxxie theme

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Thanks John,

You wont find minimal on the list you are looking at - as Mary says that is a list of themes with their own custom settings pages. Minimal was written for a specific need for Amine to create a very basic child theme of boxxie that could then be developed further. As such (and in line with boxxie itself not having any) it doesn't have any custom settings page, although one could be added to it - or as Mary suggests, you could clone one of the themes which already has a settings page smile

Richard

In reply to Richard Oelmann

Re: customizing boxxie theme

by Ramesh B -

Hi Richard,

Please, help me. How can i display multi language menu list on front-page in minimal theme