[Zope] newbie question about nested <dtml-in> tags

Toby Dickenson tdickenson@geminidataloggers.com
Wed, 19 Jun 2002 15:03:45 +0100


On Wednesday 19 Jun 2002 2:54 pm, John P. Looney wrote:
>  I have some code to generate some simple folders, for a side tree-bar.
> "foldername" contains all my site data.
>
>  The idea is that as I walk through the folders in "foldername", I prin=
t
> out a link to it, and then if I happen to be in that folder at the mome=
nt,
> I print out a list of all its subfolders etc.
>
>  However, I don't think that I can access the "id" variable as an objec=
t,
> can I ? What should I be trying to do ? Is there a better way of doing =
it
> than this ? (which nearly works!)
>
> <a href=3D"/">home</a>
> <dtml-in expr=3D"foldername.objectValues(['Folder'])">
>     <a href=3D"<dtml-var absolute_url>"><dtml-var title></a>
>     <dtml-if expr=3D"'/foldername/' + id =3D=3D REQUEST.PATH_TRANSLATED=
">
>        <ul>
>        <dtml-in expr=3D"id.objectValue(['Folder'])">
>          <li><a href=3D"<dtml-var absolute_url>"><dtml-var title></a>
>        </dtml-in>
>        </ul>
>     </dtml-if>
> <p><dtml-var id></p>


Inside the body of the outer dtml-in, its sequence-item objects (the fold=
ers)=20
are pushed onto the dtml namespace stack. It is sufficient to do just:

<dtml-in "objectValues(['Folder'])">