Wednesday 21 January 2009 5:32:39 am
After a bit trial & error and inspiration by other template extensions, I solved it this way: 1. Inside the extension directory create following directory structure
texttoimage_ext
texttoimage_ext/autoloads
texttoimage_ext/lib
texttoimage_ext/settings
2. Copy the 2 original files from the link in the posting above into the lib directory 3. In "autoloads", create a file "eztemplateautoload.php" with following content
<?php
// Operator autoloading
$eZTemplateOperatorArray = array();
$eZTemplateOperatorArray[] =
array( 'script' => 'extension/texttoimage_ext/lib/eztemplateimageoperator_ext.php',
'class' => 'ezTemplateImageOperatorExt',
'operator_names' => array( 'texttoimageext' ) );
?>
4. In "settings", create a file "site.ini.append.php" with following content
#?ini charset="iso-8859-1"?
# eZ publish configuration file.
[TemplateSettings]
AutoloadPathList[]=extension/texttoimage_ext/autoloads
5. activate the extension and clear the cache Now you can use the new operator "texttoimageext" in your templates. I don't really have enough experience to code ezPublish extensions, so there might be more elegant ways, but at least it works for me.
|