Afterburner 2.4 - fix centre column width

Re: Afterburner 2.4 - fix centre column width

by Darren Bucknell -
Number of replies: 9

Mary, you are a lady and a scholar!  I shall give this a try and edit the .css file first thing Monday morning.

Thank you smile

In reply to Darren Bucknell

Re: Afterburner 2.4 - fix centre column width

by Darren Bucknell -

Hi Mary,

I made the changes to the .css file but unfortunately it did not work.

The side columns did change size but the content of the colums became distorted and unreadable as it was shifted off the section sad

The centre column also seemed to stay very narrow.

For now, I've loaded into 2.4.1, our customised 2.3.1 Afterburner theme which seems to work.

I know there have been some code changes to the themes to support Moodle's new code base and hope I can re-integrate the latest theme with some changes to meet our spec.

Thank you again for your help and support.

Darren

In reply to Darren Bucknell

Re: Afterburner 2.4 - fix centre column width

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

Hi Darren,

That's OK to add your old theme back, it would be better if you renamed your theme to another name then it would be safe to leave it be when you upgrade next time.

I am planning an reworking Afterburner to add some extra setting so that Admins can set their own side block widths. In fact MDL-35217 has been set up to do this.

Cheers

Mary

In reply to Mary Evans

Re: Afterburner 2.4 - fix centre column width

by Darren Bucknell -

That would be great Mary as the general Afterburner theme fits well with our branding - give or take a tweak or two!

How easy is it to rename a theme?  I understand that all references to the theme's name have to be replaced with the new name and this involves digging into most of the theme code.

 

Cheers,

Darren

In reply to Darren Bucknell

Re: Afterburner 2.4 - fix centre column width

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

The main places where you HAVE to rename are as follows...

FIRST - which I nearly forgot!!!

The afterburner folder name itself...

moodle/theme/afterburner

Where you see this afterburner change it to your theme's name, be sure to use lowercase letters.


/config.php
$THEME->name = 'afterburner';
$THEME->csspostprocess = 'afterburner_process_css';

Search and replace all instances (17) of afterburner with your theme's name

/lib.php (5)
/renderers.php (1)
/settings.php (9)
/version.php (2)

Last but not the least:

First you need to rename this file to read the name of your theme like so...

yourtheme/lang/en/theme_afterburner.php

Then in
yourtheme/lang/en/theme_yourtheme.php
change the following...

$string['configtitle'] = 'Afterburner Custom Settings';

$string['pluginname'] = 'Afterburner';

You can change the names on the CSS stylesheets but this is not a ptoblem. But if you do change these be sure to change afterburner/config.php too to reflect those changes you make.

See afterburner/style for all the CSS files

afterburner_blocks.css
afterburner_calendar.css
afterburner_dock.css
afterburner_menu.css
afterburner_mod.css
afterburner_pagelayout.css
afterburner_rtl.css
afterburner_settings.css
afterburner_styles.css  

And then change these to correspond to your changes

$THEME->sheets = array(
    'afterburner_pagelayout',   /** Must come first: page layout **/
    'afterburner_styles',   /** Must come second: default styles **/
    'afterburner_menu',
    'afterburner_blocks',
    'afterburner_mod',
    'afterburner_calendar',
    'afterburner_dock',
    'afterburner_rtl',
    'afterburner_settings',
);

HTH

Mary

In reply to Mary Evans

Re: Afterburner 2.4 - fix centre column width

by Darren Bucknell -

Superb - thanks Mary.

Half term coming up so will set asside some Moodle time smile

All the best,

Darren 

In reply to Mary Evans

Re: Afterburner 2.4 - fix centre column width

by Alan Hovden -

Hi Mary... I think when I first re-themed Afterburner back in 2.1 the instructions on moodle.org were much simpler for cloning a theme - or maybe I missed the page with all the changes you have written up here. I found a bit at the bottom of the this page http://docs.moodle.org/dev/Cloning_a_theme that looks like the instructions I read on moodle.org at the time I did the first re-theming. Here's the section copied from that page:

Recipe for the Impatient

For those who want a minimal set of instructions to semi-blindly blast through this:

1. Copy [moodleroot]/theme/boxxie to [moodleroot]/theme/foxxie

2. Rename [moodleroot]/theme/foxxie/lang/en/theme_boxxie.php to [moodleroot]/theme/foxxie/lang/en/theme_foxxie.php

3. In [moodleroot]/theme/foxxie/lang/en/theme_foxxie.php, replace any instances of "boxxie" with "foxxie", likewise for "Boxxie" and "Foxxie".

4. Edit [moodleroot]/theme/foxxie/config.php to replace instance(s) of "boxxie" with "foxxie".

You can see this is considerably simpler. It seems though, that the theme I developed using this more simplistic approach is working all the way up to Moodle 2.4. Should I be worried?

 

 

In reply to Alan Hovden

Re: Afterburner 2.4 - fix centre column width

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

If you are happy with your theme, you dont need to worry.

Here's an updated version of my Tutorial, which is based on the Afterburner theme.

http://docs.moodle.org/dev/Themes_2.2_how_to_clone_a_Moodle_2.2_theme

In reply to Mary Evans

Re: Afterburner 2.4 - fix centre column width

by Alan Hovden -

Thanks Mary! One more thing if you don't mind... it says in your tutorial to update all the theme names in settings.php, renderers.php and lib.php. I have not done that in my theme but it seems to be working alright. Is it necessary to change these files? Is there a reason for changing them that will make a difference to how the theme performs?

In reply to Alan Hovden

Re: Afterburner 2.4 - fix centre column width

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

It all depends on which version of Afterburner you cloned, and also if your theme is inheriting the Afterburner theme. In other words is Afterburner your custom theme's parent theme?

Afterburner was added to Moodle core in Moodle 2.1.

In Moodle 2.2 some custom settings were added to Afterburner. So if this is the version you copied, then you should be renaming the settings.php, and lib.php otherwise you will not be able to use the custom settings for your theme.

In Moodle 2.3 the layout was changed to a fluid layout and specific functions added to enable the swapping of the side blocks for RTL (Right to Left) languages. So layout/default.php changed as did a lot of the CSS particularly the pagelayout.css

In Moodle 2.5 Afterburner will have a file-picker in the Custom setting page so that you can now upload a logo rather than just add the URL.

All these changes will make it necessary for you to rename these files if you choose to clone the 2.5 version. It's quite complex, but still achievable if you take care with the renaming .

Hope this answers your questions?

Cheers

Mary