[Zope] Using standard_html_header to display banner
Steve Spicklemire
steve@spvi.com
Sun, 28 Apr 2002 20:13:35 -0500
Hi EvH,
Use a DTML method, but use <dtml-var document_title>
-steve
On Sunday, April 28, 2002, at 06:03 PM, EvH wrote:
> Hi,
>
> I've been checking out Zope by reading the Zope Book, and am stuck =
with=20
> something: I'm building an intranet to contain documents. Each =
document=20
> should have a banner to display the document's Title and a bitmap =
whose=20
> id is the document's title and ".png" appended.
> For instance, a document called "widget.html" will have a Title =
section=20
> called "Quick & Dirty Guide to Widgets", and the Image object =
displayed=20
> 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=3D"0" width=3D"100%">
> =A0=A0=A0 <tr>
> =A0=A0=A0=A0=A0=A0=A0 <td width=3D"70%"><h1><dtml-var title></h1></td>
> =A0=A0=A0=A0=A0=A0=A0 <td align=3D"right"><img src=3D"<dtml-var =
id>.png"></td>
> =A0=A0=A0 </tr>
> </table>
>
> 2. And here's the index_html DTML Method that includes code to display=20=
> a list of sub-folders:
>
> <dtml-var standard_html_header>
>
> <table width=3D100% border=3D0>
>
> <dtml-in expr=3D"objectValues('Folder')">
> =A0=A0=A0 <tr>
> =A0=A0=A0 <td><a href=3D"&dtml-absolute_url;"><dtml-var =
title_or_id></a></td>
> =A0=A0=A0 <td><dtml-var bobobase_modification_time fmt=3D"aCommon"><td>
> =A0=A0=A0 </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=20
> standard_html_header shows the container's Title (!) instead of the=20
> document's Title
> - If I use a DTML Document instead, <dtml-var title> does show the=20
> 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=20
> including <dtml-var standard_html_header> ?
>
> Thx a bunch for any tip
> EvH.
>