I have a certain few pages that I do not want to have the standard three column layout. I am using the Zen theme and built a subtheme off of it and in that subtheme's folder I placed the page.tpl.php template. I also created a content type called map_viewer. When I use 'Themer Info' for the page I see that the candidate template files are:
page-node-2.tpl.php < page-node.tpl.php < page.tpl.php
When I use 'Themer Info' on the node on that page I see the following candidate template files:
node-map_viewer.tpl.php < node.tpl.php
The node templates are not what I want as I want to remove the left and right columns, I assume that I need to use the page template, however, I see no way of using the page template to target a content type, such as
page-map_viewer.tpl.php (I tried that and it did not work)
I did what I needed by creating page-node-2.tpl.php and removed the left and right columns (regions) and that worked. The problem is that it will only be used for that one page and not for any page that is of a certain content type, in this case 'map_viewer'.
Am I going about this in the wrong way?
I just took a quick theming class and we did something like node--content_type.tpl.php but I'm not seeing any double hyphens in this case, all of the candidate files have single hyphens. The class that I took was with Drupal 7 and I am using Drupal 6. Do 6 and 7 do this differently or am I missing something?
Comments
See working with template
See working with template suggestions http://drupal.org/node/223440#custom-suggestions
I'm seeing that I can use a
I'm seeing that I can use a custom node template for a specific content type but I'm not seeing how I can use a custom page template for a specific content type. The examples that they give are:
I see that I can simply change 'mytype' to the desired content type and I'm good.
But if I want to change the page template for a content type I see no way of doing that. The examples given are:
I would like to do something like 'page-node-mytype.tpl.php but I'm not seeing that it's possible to do it this way. Is this something that can be done?
Am I correct in my assumption
Am I correct in my assumption that I cannot use a version of page.tpl.php to target pages that are built upon a specific content type? I see that I can use a version of node.tpl.php to do this but not page.tpl.php.
If this is indeed the case, how would one remove the left and right sidebars of any page of a specific content type?
Read the whole page of the
Read the whole page of the link above!
From the page above putting this in your theme template.php file will enable you to use page-node-[contenttype] as your template for that content type.
using this code, and my theme
using this code, and my theme name in place of themename, I am getting the following eror thrown up:
The error is on the is statement in the third line of the code above.
Any ideas?
Anthony Pero
Project Lead
Virtuosic Media
http://www.virtuosic.me/
context module
Another way to approach this is to use the context module, which will let you reorganize the content depending on things like the path or the node type. Not sure if it will do what you want, but its a powerful tool for stuff like this.