3 Jan
2003
3 Jan
'03
7:27 p.m.
beno wrote at 2003-1-3 05:40 -0400:
I have a python script I call from a page template. Here's the call:
<p tal:replace="structure python:here.contentMacro(template.id)" />
Here's the script:
template_id = template_id[:-4] if (template_id[:-5] != 'frame') template_id = template_id + '_frame' content = "<p tal:replace='here/" + template_id + "_content/macros/content' />\n" print content return printed
If this is called from either *index.zpt* or *index_frame.zpt* it renders the following code:
<p tal:replace='here/index_frame_content/macros/content' /> When you want to expand a macro, you should use the attribute designed for this, that is "metal:use-macro"...
Dieter