Re: Overriding work around
Jan-Wijbrand Kolman <[email protected]>
| Newsgroups | gmane.comp.web.zope.silva.devel |
|---|---|
| Organization | Infrae |
| Message-ID | <[email protected]> |
Martijn Faassen wrote:
> Benno Luthiger wrote:
> [snip]
>
>>> If it is indeed not working for
>>> index documents but it does work for other documents, something quite
>>> peculiar looks to be going on that we need to investigate further.
>>
>> I would say the behaviour is consistent: All documents are displayed not
>> overriden. Only the container that implicitely takes the default
>> content is
>> rendered using override.html.
>
> Peculiar. At first sight, I'd consider this a bug. I'll add something to
> the issue tracker and I'll look into getting someone to investigate this.
The 'index_html' script checks whether there's an 'override.html' in the current
context, *regardless* of acquisistion. The responsible line in 'index_html':
override = 'override.html'
content = 'content.html'
if hasattr(context.aq_explicit, override):
renderer = override
else:
renderer = content
That's why an override.html in an Container is not used for a Document in the
this Container. Becasue there's no override.html in the Document's context
*itself*.
AFAIK, this behaviour has been there forever - i.e. since we first built the
layout_macro.html/content.html/override.html triple.
(Actually I do remember a hack by someone a long time ago, where he put an
override.html inside a Document to override the layout of this particular
document! - this can be done, since Documents are actually Zope folders).
I just hope I didn't completely misunderstand your discussion...
regards,
jw
--
Jan-Wijbrand Kolman
[email protected]