Different page.tpl.php depending on URL


first of all makes copies of the page.tlp.php and name them depending on how your site is structured.

front and admin ideally will be called page-front.tpl.php, page-admin.tpl.php or page-default.tpl.php ...etc

then place this code to into the page.tpl.php - the file should be completely empty except for this code.

<?php

if (arg(0)=="node" && arg(1)=="2") {/* check if the path is example.com/gallery */
include 'page-gallery.tpl.php'; /*load a custom page-gallery.tpl.php */
return; }

if ($is_front) {/* check if the frontpage */
include 'page-front.tpl.php'; /*load page-front.tpl.php */
return; }

/*insert more if statements for the layout calls here before the call to page-default.tpl.php */

else{
include 'page-default.tpl.php'; /*if none of the above applies, load the page-default.tpl.php */
return; }

?>

and there you go...you can style to your hearts content.

Please note there maybe a better more drupal way of doing this using the template.php and hook calls, i am currently investigating.




Bg