[Zope] Using standard_html_header to display banner

Frederic Faure ffaure@bigfoot.com
Mon, 29 Apr 2002 12:00:33 +0200


At 20:13 28/04/2002 -0500, Steve Spicklemire wrote:
>Use a DTML method, but use <dtml-var document_title>

Thx much Steve, but as explained before, it doesn't work as planned. Try 
this if you want to see the problem:
1. Create a test/ folder
2. Inside this folder, create a DTML Method object with ID = 
standard_html_header with the following code:
<html><head><title><dtml-var title></title></head>
<body>document_title = <dtml-var document_title><P>title = <dtml-var title><P>
3. Still inside the folder, create a DTML Method object with ID = 
dtml_method.html with the following code:
<dtml-var standard_html_header>
4. Still inside the folder, create a DTML Document object with ID = 
dtml_document.html with the following code:
<dtml-var standard_html_header>
5. Aim your browser at http://localhost:8080/test/dtml_method.html and 
http://localhost:8080/test/dtml_document.html

Result: With both objects, <dtml-var document_title> displays the Title 
section of the standard_html_header object ("Standard HTML Header", in my 
case), but dtml_method.html displays "title = This is a test folder", while 
dtml_document.html displays "title = This is a Document"

Conclusion:
- If the document itself is a DTML Method, <dtml-var title> displays the 
Title section of the _container_ where the document lives
- If the document is a DTML Document, <dtml-var title> displays the Title 
section of the _document_ itself

Therefore, the designer has to decide whether s/he wishes to display a 
document's properties dynamically through a common standard_html_header 
DTML Method object (use DTML Document) or embed some code (use DTML 
Method), but not both.
Bummer, because in index_html, in addition to displaying a banner 
dynamically through standard_html_header, I'd like to have Zope display 
links to all the documents located in sub-folders so that I wouldn't have 
to update index_html when a user has added a document in a sub-folder... 
I'll keep reading the Zope book to see if those two goals can be achieved 
through other ways.

Thx again
Eddie.