Hi

I have created a sub-theme for versatile comprising:
- css/mytheme.css,
- plugins/layouts/mytheme_column_two
- mytheme.info

name = Mytheme
description = something
core = 7.x
base theme = versatile
; Stylesheets
stylesheets[all][] = css/mytheme.css
; Plugins
plugins[panels][layouts] = plugins/layouts
plugins[panels][styles] = plugins/styles 

When I set this sub-theme to be default and go to panels layout I get the following messages:

Notice: Undefined variable: doctype in include() (line 1 of /var/www/domain/sites/all/themes/versatile/themes/versatile_html5/templates/html.tpl.php).
Notice: Undefined variable: rdf_version in include() (line 2 of /var/www/domain/sites/all/themes/versatile/themes/versatile_html5/templates/html.tpl.php).
Notice: Undefined variable: rdf_profile in include() (line 3 of /var/www/domain/sites/all/themes/versatile/themes/versatile_html5/templates/html.tpl.php).

If I remove themes/versatile/themes/versatile_html5 or set versatile to default then the messages disappear.

Any idea what I should amend, add or tweak to avoid these messages when my sub-theme is default?

Thanks

PS Great theme!

Comments

peter törnstrand’s picture

You could probably get around this by adding the following code to your template.php

/**
 * Implements template_proprocess_html().
 */
function YOUR_THEME_preprocess_html(&$vars) {
  if (module_exists('rdf')) {
    $vars['doctype'] = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML+RDFa 1.1//EN">' . "\n";
    $vars['rdf_version'] = ' version="HTML+RDFa 1.1"';
    $vars['rdf_profile'] = ' profile="' . $vars['grddl_profile'] . '"';
  }
  else {
    $vars['doctype'] = '<!DOCTYPE html>' . "\n";
    $vars['rdf_version'] = '';
    $vars['rdf_profile'] = '';
  }
}

/**
 * Preprocess function for site template layout.
 */
function YOUR_THEME_preprocess_YOUR_THEME_site_template(&$vars) {
  versatile_preprocess_versatile_site_template($vars);
}

It's a work around until I get the chance to have a look at this.

Is the Versatile base theme activated? That could also be a problem if it's not.

dig1’s picture

Yes the Versatile base theme is activated.

Action summary
I have done the following:
1) created a template.php file and added your suggestions
2) copied over the versatile_site_template and modified it for mytheme sub-theme
3) changed site_template layout from versatile_site_template to mytheme_site_template

Results summary
1) the error messages have now disappeared :)
2) the mytheme_site_template is working and I can still get the same some responsiveness as when using versatile_site_template :)

So that is great news.

It would be a nice extra if I was able to get mytheme_w640.css read by mytheme...I have added the following to template.php but mytheme still reads 'versatile/css/versatile_w640.css' and not 'mytheme/css/mytheme_w640.css'

/**
* Preprocess function for site template layout.
*/
function mytheme_preprocess_mytheme_site_template(&$vars) {
  versatile_preprocess_versatile_site_template($vars);

  $responsive = theme_get_setting('mytheme_responsive');
  if ($responsive) {
    $module_path = drupal_get_path('theme', 'mytheme');
    drupal_add_css($module_path . '/css/mytheme_w640.css', array('media' => 'screen and (max-width:640px) and (min-width:481px)'));
    drupal_add_css($module_path . '/css/mytheme_w480.css', array('media' => 'screen and (max-width:480px)'));
  }
}

Is that making things too complicated? Thanks for your help on this.

dig1’s picture

Status: Active » Fixed

This is now fixed as per https://drupal.org/node/1454308.

Thanks

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.