[Zope] where are you sticking site-wide methods/resources ? (too manyDTML-WITH's) DTML-WITH's)
Phil Harris
phil@philh.org
Wed, 29 Sep 1999 08:38:57 +0100
Couldn't you just do something like (untested)
<dtml-var "Imports.folder.method()">
Would that help at all?
Phil
phil@philh.org
-----Original Message-----
From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of chas
Sent: Wednesday, September 29, 1999 8:46 AM
To: zope@zope.org
Subject: [Zope] where are you sticking site-wide methods/resources ?
(too manyDTML-WITH's) DTML-WITH's)
In the past 3 weeks I've reorganised my code as many times and
I still haven't come to an optimal solution. So, may I ask :
how are others doing this ?
For example, I have 50+ DTML methods and 40+ external methods which
are used throughout the site (I have many more of each which are
specific to certain folders but they're not a problem.)
The most convenient thing would be to stick these 'site-wide' methods
in the root folder of Zope but then I had to scroll 2 pages to get to
the pulldown menu and, basically, I didn't like it.
So, I stuck all of these into a folder called /Imports and split
them into further subfolders. Then I use
<DTML-WITH "Imports"><DTML-VAR methodname></DTML-WITH>
or
<DTML-WITH "Imports.Subfolder"><DTML-VAR methodname></DTML-WITH>
This caused quite a few headaches at first as variables disappeared
often. But the biggest problem has been that my pages are so full
of <DTML-WITH>'s that I'm losing a lot of the 'thoughtspace' (ie. I
can't just look at a page and easily grok what it does - all I see is
these WITH's) ... this bodes not well for a large, long term project.
What I love about Python is that I can write
import module1, module2, module3
at the top of a script and be done with it. The rest of the code is
then elegant and clean. The equivalent in DTML would be to put
<DTML-WITH Imports> into standard_html_header and </DTML-WITH>
in the footer but obviously that is not possible because it
would royally screw up the namespace/acquisition.
Am I overlooking something here ?
cheers,
chas
_______________________________________________
Zope maillist - Zope@zope.org
http://www.zope.org/mailman/listinfo/zope
(To receive general Zope announcements, see:
http://www.zope.org/mailman/listinfo/zope-announce
For developer-specific issues, zope-dev@zope.org -
http://www.zope.org/mailman/listinfo/zope-dev )