Last updated March 1, 2011. Created by LinL on October 20, 2004.
Edited by aspilicious, admin7, ronald_istos, Jeff Burnz. Log in to edit this page.

PHPTemplate is a theme engine written by Adrian Rossouw (who was also behind the theme reforms in Drupal 4.5).

It uses individual something.tpl.php files to theme Drupal's theme_something() functions. Drupal's themeable functions are documented on the Drupal API site. Every file contains an HTML skeleton with some simple PHP statements for the dynamic data. Thus, PHPTemplate is an excellent choice for theming if you know a bit of PHP: with some basic PHP snippets, you can create advanced themes easily.

If you don't know PHP, then PHPTemplate can still be a good choice because only small bits of code are involved. They can just be copy/pasted into your template.

An extended Forum discussion provides some of the reasoning behind the creation of PHPTemplate.

Tips: Print out available variables

Print the variables array

<?php
print '<pre>';
print_r(get_defined_vars());
print
'</pre>';
?>

Print the variables array with the HTML markup

<?php
print '<pre>';
print
htmlspecialchars(print_r(get_defined_vars(), TRUE), ENT_QUOTES);
print
'</pre>';
?>

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

I notice that the variables on the page.tpl.php list do not reflect changes made from Drupal 5 to 6. D5 named the side bar regions $sidebar_left and $sidebar_right where now D6 calls them $right and $left. Search does not turn up results for D6 phptemplate, nor does Google.

The theme guide is located at the top left in the menu.

http://drupal.org/theme-guide/6

---
Shane Birley
Left Right Minds
http://www.leftrightminds.com

Thanks Shane. More specifically, this is what I was looking for:
http://drupal.org/node/190815

Makes sense that the alias of /phptemplate get pointed to the current D6 release, rather than D5. I would do it but I don't have the admin powers to change aliases.

That is exactly what i needed!!