[Zope] generalized viewer in zpt
David Bear
David.Bear@asu.edu
Wed, 16 Jul 2003 09:49:13 -0700
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"