Best way to switch page.tpl.php based on node type?

dougstum - July 24, 2007 - 04:13

I need to switch from three column to two column layout based on node type (e.g., when I display a node of type foo I want to switch layout.) Should I do this directly in page.tpl.php?

Thanks!

Read this

gopher - July 24, 2007 - 05:02

If you only want to

patrickharris - July 24, 2007 - 08:09

If you only want to 'turn a column off', it might be easier to just do an if then statement around the column in question in your page template.

Just for the record, in Drupal 5, as well as node-$type.tpl.php, you can also associate a new page template with a url. As the Pro Drupal Development book points out, the url 'http:/example.com/?q=node/1/edit' will map to

page-node-edit.tpl.php
page-node-1.tpl.php
page-node.tpl.php
page.tpl.php

To create a custom template for the front page, use page-front.tpl.php.

hi i've create

jingjang - December 1, 2008 - 04:15

hi
i've create page-front.tpl.php
but now i want to make a switch in theme settings. so user can turn is on or off
how can i do that ?

i know how to make switch in theme settings for other stuff, but with page-front.tpl.php i dont know how ?
can i do that with themeable functions?

thanks.

 
 

Drupal is a registered trademark of Dries Buytaert.