[ZPT] PageTemplateFile s and product attributes

Troy Farrell troy@entheossoft.com
Wed, 11 Dec 2002 12:43:41 -0600


Say, that post was rather short on information.
When I say "the same method that everyone else does," I mean this:

<h1 tal:replace="structure here/manage_page_header">Header</h1>

When I say "access my products 'icon' attribute," I mean this:

<img tal:attributes="src string:/${here/icon}"
      alt="product icon" />

This works in ZODB, and not on the filesystem.

Thanks.
Troy

Troy Farrell wrote:
> Greetings guys and gals.
> I have a security related question.  It appears to be related to the 
> question posed by Dylan at
> http://lists.zope.org/pipermail/zpt/2002-December/004112.html
> 
> I have a python product.  It uses PageTemplateFiles.  It uses them for 
> the management interface.  If I were smart, I would use the same method 
> that everyone else does to build the tabs and banner, but I'm not, so 
> I've written my own (actually, I just wanted them to validate - is that 
> too much to ask?)  The problem comes when the PageTemplateFile tries to 
> access my products 'icon' attribute, or any other attribute (should I 
> say property?)  If I create the exact same PageTemplate in the ZODB, it 
> works fine, but not coming from the filesystem.  If I use 
> security.setDefaultAccess("allow"), it works.  Basically, my question is 
> this:
> 
> How can a PageTemplate file be set in a product so that it can access 
> the product's attributes without using security.setDefaultAccess("allow")?
> 
> Again: ZPT in ZODB works, PageTemplateFile does not work.
> 
> Thanks for listening (or reading).
> Troy