Thursday 14 August 2008 3:07:22 pm
Hi Rodrigo, You could try a slightly different approach. Of course it really depends on what it is you're trying to achieve - I mean, if in your extension (for example) you have multiple templates that require access to this same variable, simply see if you can combine the templates and use different sections of code within that template depending on a user action or settings change or whatever. You could also include your template where your $var is defined, inside another template. Just look at pagelayout.tpl for how this is done. The other, slightly more involved solution is to make use of eZ's "Custom Tags". (http://ez.no/doc/ez_publish/technical_manual/4_0/reference/datatypes/xml_block/custom_tags) The general idea with these is that you build a small template file and store it in a specific directory. The file is like an HTML fragment, not complete page. You then reference that template via the online editor's "insert object" dialogue box. What this means is, you can insert dynamic content, directly into the online editor and in <b>multiple pages</b>. So when the content of your template changes (say due to user posting some data to a custom class of your own) the content also changes in every page you have included this template. If this last solution sounds ideal, do what I did and take half a day or so to complete a tutorial and read the docs carefully. It really is well-worth it!
Good luck :-) Russ
Russell Michell, Wellington, New Zealand.
We're building! http://www.theruss.com/blog/
I'm on Twitter: http://twitter.com/therussdotcom
Believe nothing, consider everything.
|