XTemplate to PHPTemplate conversion
XTemplate to PHPTemplate conversion
Firstly rename the xtemplate.xtmpl file to original.xtmpl so that the theme is no longer a xtemplate theme.
- Creating page.tpl.php
- copy original.xtmpl to page.tpl.php
- Remove the node, comment, box, and block sections. In the place of these sections add the following code
<?php echo $content ?> - Change all the "{" characters to "<?php print $"
- Change all the "}" characters to "; ?>"
- Change the "$footer" to "$closure"
- Change "$message" to "$messages"
- As the primary and secondary links in phptemplate are arrays you will need to change them from "echo $primary_links;" to "echo theme('links', $primary_links);". Also the same needs to be done for secondary links.
- In the blocks section we need to change the $block to either $sidebar_left or $sidebar_right depending on which side of the content it is on.
- Creating node.tpl.php
- Copy the node section from the original.xtmpl to a new file node.tpl.php
- As before change all the "{" and "}" characters to "<?php print $" and "; ?>" respectively.
- change $link to $node_url.
- Change "$taxonomy" to "$terms"
- Change "print $sticky;" to "if ($sticky) { print " sticky"; }"
- Change "print $picture;" to "if ($picture) { print $picture; }"
- As both the page.tpl.php and node.tpl.php have the displaying of the title twice. To get around this you need to only display the header when $main = 1. You will need to add the following around the $title line. "<?php if ($main) { ?>...<?php } ?>"
- Creating comment.tpl.php
- Copy the comment section from the original.xtmpl to a new file comment.tpl.php
- As before change all the "{" and "}" characters to "<?php print $" and "; ?>" respectively.
- Change "print $picture;" to "if ($picture) { print $picture; }"
Also just to be clean, you may want to change the displaying of the new so it will only show when the $new != ''
- Create block.tpl.php
- Copy the block section from the original.xtmpl to a new file block.tpl.php
- As before change all the "{" and "}" characters to "<?php print $block->" and "; ?>" respectively.
- Then change the $block->title to $block->subject.
- Create box.tpl.php
- Copy the box section from the original.xtmpl to a new file box.tpl.php
- As before change all the "{" and "}" characters to "<?php print $" and "; ?>" respectively.
Correction
Replace <?php echo $comment ?> with <?php echo $content ?> at 'Creating page.tpl.php'
Unclear instruction
I think this is what needs to be put in for the new to show only when comment is new:
<?php if ($comment->new) : ?><span class="new"> *<?php print $new ?></span><?php endif; ?>
I had to go looking for it, so maybe this will save someone the trouble.
Excerpted from the Drupal handbook
pages are © copyright 2000-2007 by the individual contributors

Teaser/main headers
To ensure that teaser headers are only displayed on the front page, and not twice on individual node pages, use:
<?php if ($page == 0): ?><h2><a xhref="/<?php print $node_url ?>"><?php print $title ?></a></h2>
<?php endif; ?>
in node.tpl.php
---
paul byrne
web monkey - http://www.leafish.co.uk/