Drupal 6 Custom content type page theme
If you ever wondered how to change the page.tpl.php for a custom content type you've found out that by default Drupal 6 doesn't know how to do it.
It's "fixed" easily by adding the following code:
- /**
- * Override or insert PHPTemplate variables into the templates.
- */
- function phptemplate_preprocess_page(&$vars) {
- // Add per content type pages
- // Add template naming suggestion. It should alway use hyphens.
- // If node type is "custom_news", it will pickup "page-custom-news.tpl.php".
- }
- }
Thanks dvessel
Comments
3 comments postedThank you!!
hhm... its not working for me. i have a content type 'affiliate' and wanted to call a template 'page-node-affiliate.tpl.php' base on node type('affiliate').
i only received a blank page...
please help...
thanks,
vsotto
This worked greart for me. I've been looking for hours!
Post new comment