[Zope] global variables
ghaley@mail.venaca.com
ghaley@mail.venaca.com
Mon, 12 Feb 2001 01:12:37 -0500 (EST)
> Hi,
> How can we declare a variable globally in Zope using dtml tags & assign
> a value
> for it ?.
>
> jacintha
>
hi,
you can do this a couple of ways.
1. create a property, one of the tabs, which can apply to the
whole site (from the very top folder down) or from within a directory to
apply only to the contents within that directory/folder.
2. if you are going to use a set of variables which are all
related, you can create a dtml document, let's say 'global', then define
the various variables you will use via the <dtml-call "REQUEST.set('',)">
method. in documents where you want to use these variables, the first
line in each document can be a dtml-var call, e.g., <dtml-var
global>. whatever variables you have defined in 'global' will then pass
to the document, and you can call them, reassign them, or whatever.
hth.
ciao!
greg.
Gregory Haley
Venaca.com