By tayknight on
I've enabled CCK in modules. I've created a content type called 'insidepages'. I'm trying to create my own layout for this content type. So, I've created a new file in themes/mytheme called
node-insidepages.tpl.php.
That didn't work, so I tried
insidepages.tpl.php
That didn't work, so I tried
page-insidepages.tpl.php
that didn't work either. They both just show what is in page.tpl.php. What am I doing wrong?
Thanks.
Comments
try this php to redirect to your template
page level templates will not recognize new content types automatically like node level templates. to redirect all nodes of a certain type to a different page template try adding the following php to the top of your page.tpl.php.
be sure to put the machine readable name for your custom content type in place of 'contenttype' in the above code. that should do it.
also, node-contenttype.tpl.php will automatically control the node output of your new content type (again replace 'contenttype' with the machine readable name).
best of luck with your drupal project.
Mark Sanders
Q Collective
Mark Sanders
Q Collective
worked
Thanks, Mark. This worked.
should work
According to http://drupal.org/node/17565, node-insidepages.tpl.php should work. Are you sure that "insidepages" is the 'type' (machine readable name) of this content type? There can be a difference between the 'type' and the 'name' (which is the human-readable name of your content type).
checked
The node name (from admin/content/types/insidepage) is "Inside page" and the type is "insidepage". So I'm stumped, cause I read that handbook page as well.
OK let me get this clear...
OK let me get this clear... In your first post you wrote that you tried "node-insidepages.tpl.php", but if the type is "insidepage", the template name should be "node-insidepage.tpl.php" (without the plural "s"). Just a typo?
yes, just a typo (my bad)
I got it to work using the above technique, but I'm still confused about why I had to do it that way.