Submitted by CoolGoose on Thu, 06/04/2009 - 21:01
Posted in
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
If you need more help on the topic feel free to add a comment or create a new post on the Forum
Thank you!!
Thank you!!
hhm... its not working for
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.
This worked greart for me. I've been looking for hours!
Thank you thank you thank
Thank you thank you thank you! What an elegant and slim solution, just what I needed!
many thanks
many thanks
Don't forget to Clear Cache!
Don't forget to Clear Cache!
Thank you so much, I have
Thank you so much, I have been trying to solve this problem for hours now!
Cheers!
Post new comment