1
votes

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)

1
I don't really understand your question? Do you have a firm grasp of the Drupal 7 template structure? html.tpl.php is where your <head></head> will live and this will be wrapped around all your page.tpl.php templates - Rawkode
I'm trying to change the html.tpl.php to another when the $node->type is equal to "newsletter" - Mr_DeLeTeD

1 Answers

3
votes
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
}