Failing Miserably on the Parent Theme issue

Failing Miserably on the Parent Theme issue

by Betty Hagood -
Number of replies: 6

I have read the docs, searched the posts, read the instructions on the site that has the second theme I want to incorporate into mine.

I have made my theme the parent, the other theme the parent, and added the statement pointing to the other .css files.

I am trying to use the Tabitha theme found on this site as I would like to have the tabbed type menus on my main page.

The same author has a course module similar to the theme, which I was able to install, however it's not what I wanted.

What exactly is supposed to happen when you use a parent and child theme?  Maybe I am misunderstanding what the output is suppossed to be or look like.

I would appreciate it if someone could let me know what I may be doing wrong, or if I am not understanding how the whole parent theme thing works.

Thank You,

Betty

Average of ratings: -
In reply to Betty Hagood

Re: Failing Miserably on the Parent Theme issue

by Urs Hunkler -
Picture of Core developers

Betty, I'll try to explain the cascading theme system.

In Moodle you can cascade themes on three levels.

1 The theme "standard" with the most up-to-date CSS. This theme is the reference and contains always all new CSS.

2 The parent theme. This can be any theme. It should reference to "styles_layout.css" at a minimum.

3 Your theme with the references to both themes above.

You described the typical use of the parent theme. If you want to take the theme "standard", another theme and then add some own CSS modifications your config.php could look like:

////////////////////////////////////////////////////////////////////////////////
/// This file contains a few configuration variables that control 
/// how Moodle uses this theme.
////////////////////////////////////////////////////////////////////////////////


$THEME->sheets = array('styles');

/// This variable is an array containing the names of all the 
/// stylesheet files you want included in this theme, and in what order
////////////////////////////////////////////////////////////////////////////////


$THEME->standardsheets = array('styles_layout');

/// This variable can be set to an array containing
/// filenames from the *STANDARD* theme.  ...
////////////////////////////////////////////////////////////////////////////////


$THEME->parent = 'Tabitha';  

/// This variable can be set to the name of a parent theme
/// which you want to have included before the current theme.
/// This can make it easy to make modifications to another 
/// theme without having to actually change the files
/// If this variable is empty or false then a parent theme 
/// is not used.
////////////////////////////////////////////////////////////////////////////////


$THEME->parentsheets = array('styles_layout','styles_fonts','styles_color');  

/// This variable can be set to an array containing
/// filenames from a chosen *PARENT* theme.  ...
////////////////////////////////////////////////////////////////////////////////

In this example you reference your own CSS file "styles.css" in the theme folder you called for example "mytheme". Secondly in the config file you reference "styles_layout.css" from "standard". And then third in the config file comes the refernce to your parent theme. Here you first write the name of the them and second reference all files in "$THEME->parentsheets = ". In your case these are the CSS files from the "Tabitha" theme you want to integrate.

The order how Moodle cascades the themes is different from the order the references are listed in the config file. Moodle styles the pages from the CSS properties in the order of the definitions in "Standard", overwrites them by the the CSS definitions in "Parent" and then overwrites them by the CSS definitions in "MyTheme". In the config file the order as you define the CSS files is "MyTheme", "Standard", "Parent".

I hope my perhaps too much in-depth explanation helps you to proceed
Urs

Average of ratings: Useful (1)
In reply to Urs Hunkler

Re: Failing Miserably on the Parent Theme issue

by Betty Hagood -

Thank you for the reply written in "real person" mode and not the high tech version smile

This is what I have when I tried making my theme the parent and tabitha the second theme:

$THEME->sheets = array('styles-moz', 'styles_tabs');

/// This variable is an array containing the names of all the
/// stylesheet files you want included in this theme, and in what order
////////////////////////////////////////////////////////////////////////////////

$THEME->parent = 'oklahoma'; 

/// This variable can be set to the name of a parent theme
/// which you want to have included before the current theme.
////////////////////////////////////////////////////////////////////////////////

$THEME->parentsheets = array('styles_layout', 'styles_fonts', 'styles_color'); 

/// This variable can be set to an array containing
/// filenames from a chosen *PARENT* theme.
---------------------------------------

The 'styles-moz', 'styles_tabs', are the only stylesheets in tabitha.

when I reversed the parent, I had:

$THEME->sheets = array('styles_layout', 'styles_fonts', 'styles_color'); 

$THEME->parent = 'tabbasic'; 

$THEME->parentsheets = array('styles-moz', 'styles_tabs');

----------------------------------------

Neither way gave me the tab layout I was trying to achieve.  Should there be more files involved between the 2 themes except the config.php?

Thank you again,

Betty

In reply to Betty Hagood

Re: Failing Miserably on the Parent Theme issue

by Urs Hunkler -
Picture of Core developers
Betty, hmmm.

Two aspects make me think. In your posting you call the theme "tabitha" and write "$THEME->parent = 'tabbasic';" in the config. Could it be that you have different names for the theme folder and the name you call it in the config file of your theme?

The calls to the parent theme are incorporated in your theme only. The parent theme is configured any way. Did you configure your themes that way?

If both questions don't help, can you post an url that I can look at your Moodle page and see if I can find some clues in the CSS file sent to the browser? With the Firefox "Web Developer Extension" you can control the CSS yourself under the menu "CSS/View CSS".

I hope that helps
Urs
In reply to Urs Hunkler

Re: Failing Miserably on the Parent Theme issue

by Betty Hagood -

The author refers to the theme as Tabitha, yet when you unzip it to the themes folder, it is tabbasic.  I'm wondering if I am mistaking this as a normal theme that can be used in the parent/child situation with any other themes.

I went through the whole course and info on the owners site and posted to the forum a couple of days ago with no results as of yet.  In the readme.html that is in the tabbasic folder is:

------------------------------

This theme is intended to be used as a parent theme for the Tabbed course format. It contains all the styles needed to display the tab course format properly.

To apply this theme set 'tabbasic' as the parent theme in your institution's theme. Add these lines to the config.php file in your theme folder.

$THEME->parent = 'tabbasic';
$THEME->parentsheets = array('styles_tabs');

-------------------------------------------------------

I thought I had been doing so well with php after customizing over a dozen zencart sites, but Moodle has made me aware, I haven't really learned anything sad

Betty

In reply to Betty Hagood

Re: Failing Miserably on the Parent Theme issue

by Urs Hunkler -
Picture of Core developers

Betty, have you looked if your CSS files overwrite the tabbasic CSS. If you work with MSIE it could be that you have one of those cache issues.

I don't know the theme "Tabitha" but it sounds interesting. For now I don't have the time to investigate more in this topic. Perhaps next week. Could you please keep me informed here how you proceed.

Urs

In reply to Urs Hunkler

Re: Failing Miserably on the Parent Theme issue

by Betty Hagood -

Thank you for all your help Urs.

What we've done at this point is selected the tabbasic theme to use, and have moved my header and footer files to overwrite the tabbasic ones.  So far so good.  Now we are just working on the tabby course format settings.

Once the last couple of kinks have been worked out, I'll send you a log-in to see what it looks like,as it requires log-in prior to entering the site.

Thank you again for all your help,

Betty