SV: [Zope] Adding attributes to PageTemplateFile

Josef Albert Meile jmeile at hotmail.com
Fri Sep 12 12:01:01 EDT 2003


>I looked at your JMZPTMacros product, and I cannot find any code, that uses
>the solution you presented.
Sorry, I forgot to mention that the JMZPTMacros are used by my JMBoring
Product. On the JMBoring class you will see:

#loads my default add form
manage_addJMBoringForm=PageTemplateFile('zpt/JMBoring_Add',globals())

#The Kind attribute is passed to the page template
manage_addJMBoringForm.Kind='JMBoring'

Then on my generic_add template (from JMZPTMacros) I do this:

<h1 tal:define="pageTitle python:here.manage_form_title(here,
request,form_title='Add %s' % template.Kind,
help_product=template.Kind,help_topic=template.Kind+'_Add.stx')"
tal:replace="structure pageTitle">Add myClass
</h1>

I use the syntax template.Kind because I'm using it inside a python
expresion. But, as Chris said, for you it would be enough to say
template/Kind or whatever you want.

Regards,
Josef

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail




More information about the Zope mailing list