Is it possible to mix several template engines on the same drupal site? I'm using the Garland theme and need continue using it, and right now, there is no Garland port to PHPTAL. But I would like to try out PHPTAL to just theme some CCK node types.

Comments

olav’s picture

Jörg,

the answer is an unfriendly "no!", I'm afraid. At least not out of the box.

It might be possible to write phptemplate functions to wrap a TAL template file, though.
To have something like in your template.php this might work (untested):

require_once 'sites/all/themes/engines/phptal/phptal.engine';

function _phptemplate_block($vars, $suggestions) {
  global $theme_engine;
  $old_engine = $theme_engine;
  $theme_engine = 'phptal';
  $result = _phptal_default('block', $vars, $suggestions);
  $theme_engine = $old_engine;
  return $result;
}

I would be interested to hear about your experience with this.

-- Olav

dvessel’s picture

Not sure about 5 but in 6 it's definitely possible by setting up your render function to detect the extension then pass it off to various rendering routines.