[Zope] var rendering question

Tony McDonald tony.mcdonald@ncl.ac.uk
Sat, 12 Jun 1999 09:35:49 +0100


> After two and a half weeks of tinkering with Zope, I have decided
> that I will ditch my conventional web technology for this new alien
> technology.  It has already rewired half my brain, so I might as well
> go for a complete rewiring job.  You sure you guys at DC aren't from
> another planet? ;-)
>

As another recent immigrant, welcome to planet Zope. If you think your brain
is rewired now, wait till you experience the 'lightbulb effect' of
acquisition! :)

> Insterad of trying to explain this in words, below is a quick snippet
> of code illustrating the problem.
>
> FRAMESET:
>
>   <frameset>
>    <frame target=title src=<!--#var title_src-->>
>    ...
>   </frameset>
>
>
> TABLESET:
>
>   <table>
>    <tr>
>     <td colspan=2>
>   <!--#var title_src-->
>     </td>
>    </tr>
>    ...
>   </table>
>

I think you need to do a level of indirection to get to your goal. In the
first instance (frameset) you want the contents of title_src. You get that
via <!--#var title_src--> (as you said). In the second instance, you want
the contents of the variable whose name is given by the value of title_src
(I think that you should make title_src a property BTW).

something like

<table>
<tr>
<td colspan=2>
<!--#var "_[title_src]"-->
</td>
...
</tr>
</table>

should work - well it did on my box! :)

This is from Amos' guide to Advanced DTML (don't let the title put you off
though). Available at http://www.zope.org/Documentation/HowTo/DTML

HTH
tone.