[Zope] Bag 'o newbie questions
Michael S. Fischer
michael@dynamine.net
Fri, 9 Aug 2002 14:40:16 -0700
Hi folks,
I'm fairly new to Zope, but I have about a year's worth of Python
experience so I understand it reasonably well.
I'm trying to convert my employer's internal engineering web server to
Zope. On the present site there's some functionality I coded in PHP
for which I'd like to create Zope equivalents. I'd appreciate any
comments or help you can offer.
1) We used PHP's "auto_prepend_file" and "auto_append_file" directives
to paste in a standard header and footer to every HTML document below
the root. Is there a facility by which we can do this in Zope without
having each page explicitly call <dtml-var> to render the header and
footer?
2) I wrote a left-side navbar that displays the directory tree of the
site. Lucky me! <dtml-tree> seems to be capable of generating an even
nicer one. Our site's directory tree looks like this:
/index_html (DTML document)
/standard_html_footer (DTML method)
/standard_html_header (DTML method)
/a/index_html (DTML document)
/a/aa/index_html (...)
/b/index_html
/c/index_html
/c/cc/index_html
/d/index_html
/d/dd/ <-- note the lack of index page here
/d/dd/ddd/index_html
And so on.
I copied over our index pages for /index_html and /a/index_html, and
modified them so that they call <dtml-var standard_html_header> and
<dtml-var standard_html_footer>. In standard_html_header, I make a
<dtml-tree> call. Here are the issues I've run into:
a) <dtml-tree> won't render unless index_html is a DTML method (it won't
work if index_html is a DTML document). Help me understand the
namespace issue here: is it not sufficient that a DTML document is
calling the DTML method that has the <dtml-tree> call?
b) I want the <dtml-tree> call to render a tree rooted at / no matter
which page a user is visiting. I tried encapsulating the <dtml-tree>
call in a <dtml-with expr="PARENTS[-1]"> as described at
<http://www.zopelabs.com/cookbook/1003151229> but when I visit
/a/index_html I see a tree rooted at /a. What am I doing wrong?
3) In directories like /d/dd, where there is no index_html page, I do
_not_ want to inherit a parent's index_html page; rather, I want to set
up my own TOC generator for the directory. What's the best way to do
this?
4) I'd like to examine the DTML namespace stack so I can understand it a
little more deeply. What's the best way to do this?
Thank you all so much for your help,
--
Michael S. Fischer / michael at dynamine.net / +1 650-533-4684
Lead Hacketeer, Dynamine Consulting, Silicon Valley, CA