Drupal - print the current/active sub theme -
im trying path current theme (which sub theme) having issues.
i have seen these 2 sites:
http://venutip.com/content/getting-path-your-subtheme http://www.website-assistant.co.uk/web-developer/path-subtheme-drupal
which has led me this: (as example)
template.php
function phptemplate_preprocess_node(&$vars) { global $theme_key; $path_to_theme = drupal_get_path('theme', $theme_key); } ?>
page.tpl
<link rel="stylesheet" href="/<?php print $path_to_theme; ?>/css/print.css" media="print" type="text/css" />
but doesnt work. missing? using drupal 6.19.
a.
in phptemplate_preprocess_node function, need add $path_to_theme variable $vars array:
function phptemplate_preprocess_node(&$vars) { global $theme_key; $vars['path_to_theme'] = drupal_get_path('theme', $theme_key); }
you able add print css via theme's .info file adding line this:
stylesheets[print][] = css/print.css
the advantage of approach css files aggregated when css aggregation enabled.
Comments
Post a Comment