[Zope] NewbieQ: Rendering DTML Documents

Andy Jewell andy_jewell@fanniemae.com
Tue, 25 Sep 2001 14:55:31 -0400


Thanks, Laurie!  That was it exactly!  Sheez, I was pulling my hair out
because
I knew it was probably an easy one.  I'm still not 100% sure of what's
going on
with that LET tag, but it's working and now I have something to read up
on
specifically.  Thanks again!

Andy

Laurie Nason wrote:

> Welcome to the list Andy!
>
> Your code seems to return only Folder objects - are you saying that you
> would like to return the DTML Documents (either in their totality or just
> their titles - you need another dtml-in statement inside the folder in
> statement. I put in the dtml-let statement (it makes life easier than trying
> to use sequence-item! as you will learn!) and then iterate over your
> documents. If you want the title of the document then use the title
> property, or if you want to render the whole document then use the
> sequence-item tag.
>
> <dtml-var standard_html_header>
>     <ul>
>         <dtml-in "objectValues(['Folder'])">
>             <li><dtml-var title></li>
>             <dtml-let item=sequence-item>
>                 <dtml-in "objectValues(['DTML Document'])">
>                     Document Title:<dtml-var title><br>
> or
>                     Document Contents:<dtml-var sequence-item><br>
>                 </dtml-in>
>             </dtml-let>
>         </dtml-in>
>     </ul>
> <dtml-var standard_html_footer>
>
> hth,
>
> Laurie
> <dtml-disclaimer>
> I kind-of tested it!
> </dtml-disclaimer>
>
> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Andy
> Jewell
> Sent: Tuesday, September 25, 2001 11:23 AM
> To: zope@zope.org
> Subject: [Zope] NewbieQ: Rendering DTML Documents
>
> Hi, all!  I also posted this to the ZopeNewbies.net discussion board before
> I
> realized there was a mailing list.  Sorry for the repeat.
>
> What I'm trying to do is to create a web page that is comprised of sections
> (Folders) and section contents (DTML Documents inside
> the folders). So, for example, if these are my folders:
>
>  * Chapter 1
>  * Chapter 2
>
> Then I would like the DTML Documents contained IN those folders to be
> displayed. So, I made an index_html method in the
> Chapter 1 folder that's something like this:
>
> <dtml-var standard_html_header>
> <ul>
> <dtml-in "objectValues(['Folder'])">
> <li><dtml-var title></li>
> </dtml-in>
> </ul>
> <dtml-var standard_html_footer>
>
> That works for giving me the TITLE of those documents, and there are plenty
> of
> examples of that in the Zope documentation. But I
> want to include the WHOLE document - something like this:
>
> <dtml-var standard_html_header>
> <dtml-in "objectValues(['Folder'])">
> <h2><dtml-var title></h2>
> <dtml-var "theCurrentDocument()">
> </dtml-in><
>
> <dtml-var standard_html_footer>
>
> So you can see I'm trying to get at what is probably the very simple $_ item
> (in perl parlance). Is there a method for the current
> document in the dtml-in loop that will render itself? Thanks so much for any
> help!
>
> Andy