[TYPO3] Is template switching on the fly possible?

Jeff Segars jsegars at alumni.rice.edu
Tue Aug 26 15:30:02 CEST 2008


ronald_lists at elmit.com wrote:
> I wonder, if and how it is possible to show one and the same site with
> different templates, so that we can easy compare them.
> 
> My first idea was just to install 15 times typo3, but when I think that
> this could lead at the end to 100, I am not so excited anymore.
> 
> Any ideas, pointers or suggestions?
> 
> bye
> 
> Ronald

Ronald,
We use a custom, internal extension for what Ron linked to at 
demo.webempoweredchurch.org. It's limited to TemplaVoila templates and 
tied to the naming conventions we use, but if you'd like a copy I can 
send it your way.

There's a lot of extra stuff going on to save template preferences and 
draw the template selector but the crux of the extension is really two 
lines of PHP that need to run before TemplaVoila.

$GLOBALS['TSFE']->page['tx_templavoila_ds'] = $data['ds'];
$GLOBALS['TSFE']->page['tx_templavoila_to'] = $data['to'];

With this, we inject values into the page record so that when 
TemplaVoila runs it uses the Data Structure and Template Object that we 
want it to.  All the other extension code is template selection, saving, 
and user interface but those two lines actually make it work.

Thanks,
Jeff

PS. If anyone else is interested in taking this code and generalizing it 
for public use, we're certainly open to that.


More information about the TYPO3-english mailing list