Posts made by Patrick Malley

Thanks Mary, it did get me closer to an understanding of what's going on. $THEME->editor_sheets should be replacing the WYSIWYG variable inside the TinyMCE folder with a stylesheet from the theme folder. This is very valuable to theme developers as we can now set default style classes for our themes to keep them looking nice.

I've filed a bug to have Sam take a look.

MDL-22247
I think $theme->basetheme = true; is confusing as it suggests there is more than one base when there isn't since we named one theme specifically as "base."

These three all seem to suggest that something is wrong if this setting is not included:

$theme->complete = true;
$theme->finished = true;
$theme->usable = true;

Of course, we want all themes in the core to be complete, finished, and usable in some way. I know what you're getting at here, but it's not as clear to the new theme developer.

These two (and Sam's original idea) make the most sense to me:

$theme->parentonly = true;
$theme->selectable = false;

Note that I've changed the boolean value in the second option so it would default to true.
I've answered my own number 2 and 3:

2.) You have to include all themes from which you want to use and then exclude the stylesheets from the parents you don't want to use by using:

$THEME->parents_exclude_sheets

Overriding the layouts in the parent themes is as easy as setting them in your own config.php.

3.) There must have been a syntax error in my pagelayout.css file because I now have it working without change to config.php.

As a side note:

If you want to build a theme on top of a theme and the base theme, be sure to set the base theme second in the array:

$THEME->parents = array('canvas','base');

For some reason, the default method for loading the stylesheets is from right to left. If you place base first, then the stylesheets from base will load lower in the cascade and will override your other parent theme.

Moodle in English -> Themes -> Parent theme issues in 2.0

by Patrick Malley -
I'm having some trouble with 2.0 theme parents and could use some prompt help to keep me working on this new theme "families" idea.

  1. My most recent commit includes two new themes:
    • Canvas - this is going to be my new family theme.
      1. Is it possible to hide this family theme as Base is hidden? Is there a setting I can add to config.php to do this?
    • Form Factor - This is a 2.0 version of my 1.9 theme called Ingenuous. It might be a bit broken now because I'm trying to build it upon Canvas, which is built upon Base.
  2. If I use Canvas as a parent, does base need to be specified explicitly as a parent too? It shouldn't since canvas has it listed as a parent. But it doesn't seem to be working properly this way.
  3. I'm having a lot of issues with stylesheets not being included from parent themes. Here's what I did:
    • Canvas excludes the Base pagelayout.css file and includes its own. I have it excluding properly, but it doesn't include the new pagelayout file from Canvas.


I think I'll leave it here for now to prevent a million questions in one single post. This should get me on track.
Average of ratings: -