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
- 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 $comment ?>
- 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.tmpl 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; }"
Creating comment.tpl.php
- Copy the comment section from the original.tmpl 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 comment section from the original.tmpl to a new file comment.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 comment section from the original.tmpl to a new file comment.tpl.php
- 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.