سؤال

Is there a way to build a drupal template for a content type which not import the tag and the begin of the tag ?

in exemple, i would create a "newsletter" content type which is based on a "page--newsletter.tpl.php" as it tell here : http://drupal.org/node/1089656 But all the xxx.tpl.php i ever seen not include the top of the HTML code

Is there a way for it ?

*EDIT : * I'm trying to change the html.tpl.php to another when the $node->type is equal to "newsletter" (look easier like that)

هل كانت مفيدة؟

المحلول

function themename_preprocess_html(&$vars, $hook) {
  if ($node = menu_get_object()) {
    array_splice($vars['theme_hook_suggestions'], -1, 0, 'html__' . str_replace('-', '_', $node->type));
  }
  #print_r($vars['theme_hook_suggestions']); // print out suggestions
}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top