hi, The previous of designer of our website left a code like this The index_html as follows <dtml-var standard_html_header> <dtml-call "REQUEST.set('PageTemplates', templates.common.content.gfx.gfx_Reports)"> PageTemplates.<dtml-var PageTemplates> <dtml-with PageTemplates> <dtml-var page_menu> <dtml-var page_content> <dtml-var page_credits> </dtml-with> <dtml-var standard_html_footer> and the folder templates as follows templates (folder) | + common (folder) | | | + page_credits (DTML method) | + content (folder) | | | + page_menu (DTML method) | + gfx (folder) | | | + page_content(DTML method) | + gfx_Reports (folder) | + showFull (DTML method) What it does means 'templates.common.content.gfx.gfx_Reports'? Folders 'common', 'content', 'gfx', and 'gfx_Reports' are in the same level in templates. Does it mean a path for acquisition? where can I that in the zope book? But acutally this expression just return a folder instance(<dtml-var PageTemplates>. If you change it to <dtml-call "REQUEST.set('PageTemplates', templates['gfx_reports'])"> you get the same folder instance, but index_html return error 'Keyerror: page_menu'. How to explain that? Thanks __________________________________ Do you Yahoo!? Get better spam protection with Yahoo! Mail. http://antispam.yahoo.com/tools
Star War wrote at 2004-2-28 12:29 -0800:
The previous of designer of our website left a code like this
The index_html as follows
<dtml-var standard_html_header> <dtml-call "REQUEST.set('PageTemplates', templates.common.content.gfx.gfx_Reports)"> PageTemplates.<dtml-var PageTemplates> ... What it does means 'templates.common.content.gfx.gfx_Reports'? Folders 'common', 'content', 'gfx', and 'gfx_Reports' are in the same level in templates. Does it mean a path for acquisition?
Almost surely.
where can I that in the zope book?
Read about acquisition... You may also look in the "Name lookup" section of <http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html>
But acutally this expression just return a folder instance(<dtml-var PageTemplates>. If you change it to
<dtml-call "REQUEST.set('PageTemplates', templates['gfx_reports'])">
you get the same folder instance, but index_html return error 'Keyerror: page_menu'.
How to explain that?
You never get a "Folder" but a so called context (or Acquisition) wrapper. This wrapper contains the object but also the way you accessed the object. The wrappers returned for "templates.gfx_reports" and "templates.content.gfx_reports" differ considerable also they both are for the main object "Folder gfx_reports". Read more about this in the above mentioned resources... -- Dieter
participants (2)
-
Dieter Maurer -
Star War