PHPTAL theme engine
This is a theme engine for Drupal 6.x, which allows the use of templates written in the PHPTAL language. This engine does most of its work by calls to the PHPtemplate engine, just replacing the underlying template engine with the one from http://phptal.sourceforge.net/.
To be used, the engine needs an installation of PHPTAL, preferably as a PEAR module. It was developed using PHPTAL 1.0.10. You can get it by saying
pear5 upgrade http://phptal.motion-twin.com/latest.tar.gz
on the command line.
I believe that this engine provides the same advantage of a combined push/pull approach for dynamic content as PHPtemplate but at the same time the template files are clean and pure XHTML. PHPTAL templates can thus be edited with most standard WYSIWYG HTML editors and are guaranteed to output valid XHTML.
PHPTAL now comes bundled with a fresh port of andreas01 which previously had to be downloaded separately. This theme appears in the list of themes as phptal once the engine is installed.
It also should work with the proto-template box_grey by Adrian Simmons for PHPTemplate, ported to PHPTAL and renamed to tal_grey.
A complete documentation on the PHPTAL template language can be found at http://phptal.sourceforge.net/ . There you also find links to the many resources for the Python-based TAL implementation.
Compare this code from theme box_grey for engine PHPtemplate
<?php if (is_array($secondary_links)) : ?>
<ul id="secondary">
<?php foreach ($secondary_links as $link): ?>
<li><?php print $link?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>with the corresponding block for PHPTAL:
<ul tal:condition="php:is_array(secondary_links)" id="secondary">
<li tal:repeat="link secondary_links" tal:content="link">secondary link</li>
</ul>If you want to override a theme function not included in the basic list (block, box, comment, node, page), you can follow the basic approach as outlined for PHPtemplate. Remember to visit admininster > build > themes for PHPTAL to refresh its cache and recognize the new file.
Releases
| Official releases | Date | Size | Links | Status | |
|---|---|---|---|---|---|
| 6.x-3.0 | 2007-Aug-27 | 6.53 KB | Download · Release notes | Recommended for 6.x | |
| 5.x-1.0 | 2007-Feb-02 | 110.3 KB | Download · Release notes | Recommended for 5.x | |
| Development snapshots | Date | Size | Links | Status | |
|---|---|---|---|---|---|
| 4.7.x-1.x-dev | 2006-Nov-13 | 8.28 KB | Download · Release notes | Development snapshot | |
