If I create a 'node-{content-type}.tpl.php' in my templates folder within my zen subtheme it won't get picked up and used. I have to drop it in the master zen/templates folder.

You could do this in 1.x, is this a bug in 2.x or do I have to create them differently?

Cheers

Comments

akalata’s picture

Category: bug » support

You'll need to copy node.tpl.php from Zen into your subtheme, in the same directory as your node-{content-type}.tpl.php. This is an existing bug in the Drupal templating system - see http://drupal.org/node/279573 for more info. :)

deastlack’s picture

Component: PHP Code » layout.css

Have copied the node.tpl.php file along with the page.tpl.php files since several postings and documentation articles implied that file should be copied as well.

Still doesn't work. cant get my content_type.tpl.php files to be recognized and used. For that matter my sub themes template.php file doesn't seem to get accessed either.

May be I got a bug elsewhere in my sub theme? any thoughts on where to look?

akalata’s picture

What is the exact name of your tpl file? You've mentioned node-content-type.tpl.php and content_type.tpl.php. It should be named node-[type-machine-name].tpl.php -- and hyphens or underscores matter there. So you might need to use node-content_type.tpl.php.

Also, don't forget to clear your theme registry! Clear cache, etc.

shruti.sheth’s picture

gowrann’s picture

add this you theme template.php file:

function YOURTHEMENAME_preprocess_page(&$variables) {
if ($variables['node']->type != "") {
$variables['template_files'][] = "page-node-" . $variables['node']->type;
  }
}

Change YOURTHEMENAME to your theme name!

echoz’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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