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

Lars Heber lheber@debis.com
Thu, 12 Oct 2000 10:29:24 +0200


Hi,

first, thanks for your advice!

"Manuel Amador (Rudd-O)" schrieb:

> <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

OK, once again:
My standard_html_header is still a METHOD!!!
And within it, I DO access to the variables of the calling document /
method!

>
> <dtml-with pub>
> <dtml-var standard......>
> </dtml-with>

That's _exactly_ what I did! I only inserted a <dtml-let
someVar="someValue"> to pass this var to standard_html_header.

>
> 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.

I DON'T!

>> So I stored my headers and footers and many other things in
>> root/intra/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:
>
Look above!

>> 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/intra/pub,
>> so I have
>> to call it within the <dtml-with pub>.
>>
>> But calling it within the <dtml-with pub>, 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,   INSERTED:   and not as wanted the title_or_id of the calling
>> document!
>
>> How can I nevertheless access within the s_h_h to the title_or_id of
>> my
>> original document?   INSERTED:   i. e. explicitely accessing to a
>> layer of the namespace which isn't on its top!
>
Hope I now explained it well enough.
Thank you very much.

Lars