[Zope] where are you sticking site-wide methods/resources ? (too many DTML-WITH's) DTML-WITH's)

chas panda@skinnyhippo.com
Wed, 29 Sep 1999 15:46:25 +0800


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