[Zope] Passing variables around.

Cornelis J. de Brabander brabander@fsw.LeidenUniv.nl
Tue, 03 Apr 2001 11:43:23 +0200


hi
> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
> Ixokai
> Sent: dinsdag 3 april 2001 8:24
> To: zope@zope.org
> Subject: [Zope] Passing variables around.
>
>
> I have a general menubar on my site, who's orientation will vary depending
> on which page its on. Sometimes its on the left, sometimes its on
> the right.
> And its color can vary, too. So that's two bits of information that I want
> to be able to pass to the dtml method /standard_menubar in each page.
>
> What i'm currently doing is this:
>
>    <dtml-let Prefix="'L-'" Color="'Orange'"><dtml-var
> standard_menubar></dtml-let>
>
> Is that the 'correct' way to pass variables around? Hmm. Would it
> be better
> to just set 'Properties' on my content_html DTML document?
>
> Speaking of. I'm designing my site with the 'One Folder per Page'
> paradigm.
> Should content_html be a DTML document or method? Are there advantages or
> disadvantages to each? My understanding is that the Folder would
> then become
> the 'object' that is the page, instead of the content_html being
> the object
> within the folder... is this correct?

Yes.
A DTML Document can have properties, a DTML method cannot. So in your case I
would use DTML methods and I would add 'Prefix' and 'Color' as properties to
the containing folder and set their value as you like. Then all you need is:

<dtml-var standard_menubar>

>
> --Ix
>

cb