I would like to create a generalized document/file viewer in zpt but I'm getting stuck in understanding some things. lets say I have a folder heirarchy like this: \ \myTemplates \publicDocument \publicDocument\stuff \publicDocument\stff2 where stuff[n] could be anything from a structure text doc, to dtml method, to a file, to .. any zope object. I would like to have some macro's in myTemplates that could automagically display whatever object it is. I'm thinking of something like ... <div metal:define-macro="stuffviewer"> <p metal:define-slot="main"> <tal:content="here/stuff"/> </p> </div> but my brain gets twisted. do I send 'stuff' to the zpt as a parameter, ie \publicDocument\myTemplate\macros\stuffviewer\stuff? the other side then is how can tal/metal 'know' that it should be doing something like <p tal:content="structure here/stuff"/> rather than <p tal:content="here/stuff"/> will I need to loop and test object type? -- David Bear phone: 480-965-8257 fax: 480-965-9189 College of Public Programs/ASU Wilson Hall 232 Tempe, AZ 85287-0803 "Beware the IP portfolio, everyone will be suspect of trespassing"
David Bear wrote:
I would like to create a generalized document/file viewer in zpt but I'm getting stuck in understanding some things.
What would this document/file view be? How would you look to invoke it? What requirements do you have that need such a thing? cheers, Chris
David Bear wrote at 2003-7-16 09:49 -0700:
... I would like to create a generalized document/file viewer ... for any zope object ... ... will I need to loop and test object type?
You probably will as objects are not standardized enough to be reasonably presented in a uniform way. Dieter
participants (3)
-
Chris Withers -
David Bear -
Dieter Maurer