[Zope] How to use standard html headers and footers properly (was: Re: [Zope] Namespace problems...) Namespace problems...)

Manuel Amador (Rudd-O) amador@alomega.com
Thu, 12 Oct 2000 00:29:17 -0500


--------------23E6B24F0134DCC66317B541
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

<dtml-with pub>
   <dtml-let titel="_.string.join(['This is the website of  ',
enterpriseName])">
      <dtml-var standard_html_header>
   </dtml-let>

on your document, WILL work fine.

But I suggest recreating standard_html_header as a METHOD and calling
<dtml-with pub>
<dtml-var standard......>
</dtml-with>

Since methods don't have properties, they will use calling object's
properties.  Read again.  Do NOT use DTML documents for headers and
footers.  Use METHODS.

Lars Heber wrote:

> Hi there,
>
> I've still got to build a bigger website.
>
> So I stored my headers and footers and many other things in root/pub.
>
> All the other documents are stored in root/Intra and below.
>
> I've got my standard_html_header, with which I can display user-defined
> titles which may also contain values of global properties. The
> user-defined title is being built in the document before the header is
> called, e. g. something like:
>
> <dtml-with pub>
>    <dtml-let titel="_.string.join(['This is the website of  ',
> enterpriseName])">
>       <dtml-var standard_html_header>
>    </dtml-let>
>
> In the standard_html_header method I'm checking whether there is a titel
> attribute or not.
>
> This works fine.
>
> But for general use I want to keep the possibility of displaying the
> title_or_id of the document when I don't introduce a user-defined title.
>
> This would be no problem if s_h_h wasn't situated in root/pub, so I have
> to call it within the <dtml-with pub>.
>
> But doing this, pub is on the top of my namespace, so that calling
> title_or_id returns the title_or_id of the container of s_h_h, i. e.
> pub!
>
> How can I nevertheless access within the s_h_h to the title_or_id of my
> original document?
>
> Thanks.
>
> Lars
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )

--
Manuel Amador (Rudd-O)



--------------23E6B24F0134DCC66317B541
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
&lt;dtml-with pub>
<br>&nbsp;&nbsp; &lt;dtml-let titel="_.string.join(['This is the website
of&nbsp; ',
<br>enterpriseName])">
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;dtml-var standard_html_header>
<br>&nbsp;&nbsp; &lt;/dtml-let>
<p>on your document, WILL&nbsp;work fine.
<p>But I suggest recreating standard_html_header as a METHOD&nbsp;and calling
<br>&lt;dtml-with pub>
<br>&lt;dtml-var standard......>
<br>&lt;/dtml-with>
<p>Since methods don't have properties, they will use calling object's
properties.&nbsp; Read again.&nbsp; Do NOT&nbsp;use DTML&nbsp;documents
for headers and footers.&nbsp; Use METHODS.
<p>Lars Heber wrote:
<blockquote TYPE=CITE>Hi there,
<p>I've still got to build a bigger website.
<p>So I stored my headers and footers and many other things in root/pub.
<p>All the other documents are stored in root/Intra and below.
<p>I've got my standard_html_header, with which I can display user-defined
<br>titles which may also contain values of global properties. The
<br>user-defined title is being built in the document before the header
is
<br>called, e. g. something like:
<p>&lt;dtml-with pub>
<br>&nbsp;&nbsp; &lt;dtml-let titel="_.string.join(['This is the website
of&nbsp; ',
<br>enterpriseName])">
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;dtml-var standard_html_header>
<br>&nbsp;&nbsp; &lt;/dtml-let>
<p>In the standard_html_header method I'm checking whether there is a titel
<br>attribute or not.
<p>This works fine.
<p>But for general use I want to keep the possibility of displaying the
<br>title_or_id of the document when I don't introduce a user-defined title.
<p>This would be no problem if s_h_h wasn't situated in root/pub, so I
have
<br>to call it within the &lt;dtml-with pub>.
<p>But doing this, pub is on the top of my namespace, so that calling
<br>title_or_id returns the title_or_id of the container of s_h_h, i. e.
<br>pub!
<p>How can I nevertheless access within the s_h_h to the title_or_id of
my
<br>original document?
<p>Thanks.
<p>Lars
<p>_______________________________________________
<br>Zope maillist&nbsp; -&nbsp; Zope@zope.org
<br><a href="http://lists.zope.org/mailman/listinfo/zope">http://lists.zope.org/mailman/listinfo/zope</a>
<br>**&nbsp;&nbsp; No cross posts or HTML encoding!&nbsp; **
<br>(Related lists -
<br>&nbsp;<a href="http://lists.zope.org/mailman/listinfo/zope-announce">http://lists.zope.org/mailman/listinfo/zope-announce</a>
<br>&nbsp;<a href="http://lists.zope.org/mailman/listinfo/zope-dev">http://lists.zope.org/mailman/listinfo/zope-dev</a>
)</blockquote>

<pre>--&nbsp;
Manuel Amador (Rudd-O)</pre>
&nbsp;</html>

--------------23E6B24F0134DCC66317B541--