[Zope] Using standard_html_header to display banner

EvH edward_van_h@bigfoot.com
Mon, 29 Apr 2002 01:03:34 +0200


--=====================_47712557==_.ALT
Content-Type: text/plain; charset="us-ascii"; format=flowed

Hi,

I've been checking out Zope by reading the Zope Book, and am stuck with 
something: I'm building an intranet to contain documents. Each document 
should have a banner to display the document's Title and a bitmap whose id 
is the document's title and ".png" appended.
For instance, a document called "widget.html" will have a Title section 
called "Quick & Dirty Guide to Widgets", and the Image object displayed 
along the title in the banner should be widget.html.png .

1. Here's the standard_html_header DTML Method:

<html>
<head><title><dtml-var title></title></head>

<body>
<table border="0" width="100%">
     <tr>
         <td width="70%"><h1><dtml-var title></h1></td>
         <td align="right"><img src="<dtml-var id>.png"></td>
     </tr>
</table>

2. And here's the index_html DTML Method that includes code to display a 
list of sub-folders:

<dtml-var standard_html_header>

<table width=100% border=0>

<dtml-in expr="objectValues('Folder')">
     <tr>
     <td><a href="&dtml-absolute_url;"><dtml-var title_or_id></a></td>
     <td><dtml-var bobobase_modification_time fmt="aCommon"><td>
     </tr>
</dtml-in>

</table>

<dtml-var standard_html_footer>

Problem:
- If I use a DTML Method object for a document, <dtml-var title> in the 
standard_html_header shows the container's Title (!) instead of the 
document's Title
- If I use a DTML Document instead, <dtml-var title> does show the 
document's Title as expected, but the <dtml-in ...> code is not run.

Do you know of any easy way to let writers include a banner by just 
including <dtml-var standard_html_header> ?

Thx a bunch for any tip
EvH.
--=====================_47712557==_.ALT
Content-Type: text/html; charset="us-ascii"

<html>
Hi,<br><br>
I've been checking out Zope by reading the Zope Book, and am stuck with
something: I'm building an intranet to contain documents. Each document
should have a banner to display the document's Title and a bitmap whose
id is the document's title and &quot;.png&quot; appended. <br>
For instance, a document called &quot;widget.html&quot; will have a Title
section called &quot;Quick &amp; Dirty Guide to Widgets&quot;, and the
Image object displayed along the title in the banner should be
widget.html.png .<br><br>
1. Here's the standard_html_header DTML Method:<br><br>
&lt;html&gt;<br>
&lt;head&gt;&lt;title&gt;&lt;dtml-var
title&gt;&lt;/title&gt;&lt;/head&gt;<br><br>
&lt;body&gt;<br>
&lt;table border=&quot;0&quot; width=&quot;100%&quot;&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;tr&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td
width=&quot;70%&quot;&gt;&lt;h1&gt;&lt;dtml-var
title&gt;&lt;/h1&gt;&lt;/td&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td
align=&quot;right&quot;&gt;&lt;img src=&quot;&lt;dtml-var
id&gt;.png&quot;&gt;&lt;/td&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br>
&lt;/table&gt;<br><br>
2. And here's the index_html DTML Method that includes code to display a
list of sub-folders:<br><br>
&lt;dtml-var standard_html_header&gt;<br><br>
&lt;table width=100% border=0&gt;<br><br>
&lt;dtml-in expr=&quot;objectValues('Folder')&quot;&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;tr&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;td&gt;&lt;a
href=&quot;&amp;dtml-absolute_url;&quot;&gt;&lt;dtml-var
title_or_id&gt;&lt;/a&gt;&lt;/td&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;td&gt;&lt;dtml-var bobobase_modification_time
fmt=&quot;aCommon&quot;&gt;&lt;td&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br>
&lt;/dtml-in&gt;<br><br>
&lt;/table&gt;<br><br>
&lt;dtml-var standard_html_footer&gt;<br><br>
Problem:<br>
- If I use a DTML Method object for a document, &lt;dtml-var title&gt; in
the standard_html_header shows the container's Title (!) instead of the
document's Title<br>
- If I use a DTML Document instead, &lt;dtml-var title&gt; does show the
document's Title as expected, but the &lt;dtml-in ...&gt; code is not
run.<br><br>
Do you know of any easy way to let writers include a banner by just
including &lt;dtml-var standard_html_header&gt; ?<br><br>
Thx a bunch for any tip<br>
EvH.</html>

--=====================_47712557==_.ALT--