I want to theme pages for a specific content type (story) by giving it it's own unique page-story-tpl.php file. The end goal is to have all story pages have a slightly different theme from other pages.

I read the documentation and duplicated the page.tpl.php file and renamed it page-story.tpl.php. and made the necessary changes. However, the Drupal ignores the theme suggestion and continues to call page.tpl.php.

Do you have any suggestions as to what I may be doing wrong?

Comments

cmckay’s picture

Status: Active » Fixed

I finally found a solution that works - http://drupal.org/node/296111

(Not sure if this is the best way of doing this however)

Jeff Burnz’s picture

Title: Template suggestion for page-[node-type] » Template suggestion for pages

Its better to this in preprocess function such as:

http://drupal.org/node/223440#comment-1101275

Jeff Burnz’s picture

Title: Template suggestion for pages » Template suggestion for page-[node-type]
Status: Fixed » Active
cmckay’s picture

Title: Template suggestion for pages » Template suggestion for page-[node-type]

Didn't quite get you...are you saying that the method you linked to is better?

I tried adding it to the template file. Duplicated the page.tpl.php file and renamed it page-node.tpl.php.

Jeff Burnz’s picture

it should be more effecient, but page-node.tpl.php is a default template suggestion and will take over all node views, you would want to make a page-[content-type] template, and then clear the registry so drupal sees the new template, make sure all these templates are in the same directory as page.tpl.php or they won't work.

cmckay’s picture

hmm...I can definitely see where it is more efficient. However, for some reason, your method doesn't work for me.