3 Jul 23:06
Dynamic Templates with Petal
I'm having troubles getting dynamic includes to work. I'm trying to do
something like this:
--- site.html
<html>
... header stuff ...
<div metal:use-macro="${content_template}#content"></div>
... footer stuff ...
</html>
where content_template is a value passed to the Petal object on
process() and contains a valid path to a file which contains
<div metal:define-macro="content">
stuff stuff stuff
</div>
Petal seems to ignore ${content_template} in this case and not parse it.
Instead, it looks for a file name ${content_template}. Is there a way
around this?
I'll put it in for the next version of Petal.
i18:domain is supported but Petal does nothing special with them (maybe
it should?)
i18n:translate and i18n:name are fully supported.
Consult Petal::I18N to see how it works.
If anybody on the list is familiar with gettext(), I could do with a
critical view on the work. Sometime I've felt I didn't really know what
I was doing :-/
I also tidied up the docs a bit (moved a lot of old backwards
compatibility stuff in Petal::Deprecated to keep the size of the docs
down) and added some tests, which never hurts.
So that's it... Petal = Perl TAL + METAL + I18N. All in one big hacky
module. Yey!
Maybe we should rename the module PeMeTALi18n
RSS Feed