xtemplate to phptemplate conversion

Posted by gordon on Sat, 27/11/2004 - 11:31am

Firstly rename the xtemplate.xtmpl file to original.xtmpl so that the theme is no longer a xtemplate theme.

Creating page.tpl.php

  1. copy original.xtmpl to page.tpl.php
  2. Remove the node, comment, box, and block sections. In the place of these sections add the following code
    <?php echo $comment ?>
  3. Change all the "{" characters to "<?php print $"
  4. Change all the "}" characters to "; ?>"
  5. Change the "$footer" to "$closure"
  6. Change "$message" to "$messages"
  7. 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.
  8. 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

  1. Copy the node section from the original.tmpl to a new file node.tpl.php
  2. As before change all the "{" and "}" characters to "<?php print $" and "; ?>" respectively.
  3. change $link to $node_url.
  4. Change "$taxonomy" to "$terms"
  5. Change "print $sticky;" to "if ($sticky) { print " sticky"; }"
  6. Change "print $picture;" to "if ($picture) { print $picture; }"

Creating comment.tpl.php

  1. Copy the comment section from the original.tmpl to a new file comment.tpl.php
  2. As before change all the "{" and "}" characters to "<?php print $" and "; ?>" respectively.
  3. 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

  1. Copy the comment section from the original.tmpl to a new file comment.tpl.php
  2. As before change all the "{" and "}" characters to "<?php print $block->" and "; ?>" respectively.
  3. Then change the $block->title to $block->subject.

Create box.tpl.php

  1. Copy the comment section from the original.tmpl to a new file comment.tpl.php
  2. As before change all the "{" and "}" characters to "<?php print $" and "; ?>" respectively.

The first steps are wrong in

The first steps are wrong in the last two tpl.php's sections. You wrote comment there.
 

Comment?

This explanation is really odd. What's with the repeated parts about comments? I have a hard time figuring out what you mean. I doubt someone who is not familiar with the inner workings of a theme system will manage.