Basics of page.tpl.php

This article shows the basics of the page templates used to work with the accessibility module for Drupal. With the exception of the page.tpl.php for the wap theme this file is very basically very similar to the regular page.tpl.php files provided in core themes.


<?php print $dtd ?>
<html <?php print $xmlns ?>lang="<?php print $language ?>">
<head>
<!-- Rest of head -->
<link rel="alternate" media="handheld" 
href="http://<?php echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>" />
</head>
<body>
<!-- Rest of body -->
</body>
</html>


This code enables:

  • Doc Type switching dependent on device
  • Adds the XMLNS statement is sending XHTML
  • Redirects away from Google Wireless Transcoder if detected


The following variables are then created in the template.php file associated with the theme: $dtd and $xmlns. $language is generally available to themes anyway.

Syndicate content