page.tpl.php

Sample page.tpl.php

  1. <?php
  2. // $Id: page.tpl.php,v 1.28 2008/01/24 09:42:52 goba Exp $
  3. ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Amorfati's page.tpl.php

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

add node type as body class

  1. page.tpl.php
  2.  
  3. <html>
  4.     <body class="<?php print($node->type) ? $node->type : 'notype';?>"</body>
  5. </html>

Fix for adding a view name class to page.tpl.php

  1. // in template.php
  2. function _phptemplate_variables($hook, $vars) {
  3.         switch ($hook) {
  4.        
  5.         case 'page':
  6.                 foreach (views_get_all_urls() as $key => $value) {
  7.                         if($_GET['q'] == $value) {
Syndicate content