[Zope] Automatic inclusion help

Stuart 'Zen' Bishop zen@cs.rmit.edu.au
Tue, 1 Feb 2000 18:38:56 +1100 (EST)


On Tue, 1 Feb 2000, M. Adam Kendall wrote:

> Because the client still wants to include the standard_html_header from
> the root to give the whole site the same look/feel.  But the client also
> doesn't want to have to hard code all his documents with the specific 
> folder header, in case they want to move a document from one folder to
> another.  Does that make things a little clearer?

> >> Is there something that I am missing here?  For some
> >> reason the dtml-if check doesn't work at all.  I
> >> need to have this check in place, just in case the
> >> object doesn't exist in some folders.
> >> 
> >> <dtml-comment> Give us folderid_html_header </dtml-comment>
> >> <dtml-let customhead="PARENTS[0].id + '_html_header'">
> >>   <dtml-comment> Check for object </dtml-comment>
> >>   <dtml-if customhead>

Here, customhead is a string that will always evaluate to true.
Try:
    <dtml-if "_[customhead]">

> >> Any ideas?  Or am I going about it completely wrong?

A slightly more flexible way of doing it would be to use a standard_html_header
DTML method in each folder that needs one that looks like this:

    <dtml-var "PARENTS[-1].standard_html_header">
    <p>My custom stuff

This will include the root standard_html_header file. It acts slightly
differently, as adding one of these to a folder will also change the
behaviour of all subfolders - might be better, or might not.

-- 
 ___
   //     Zen (alias Stuart Bishop)     Work: zen@cs.rmit.edu.au
  // E N  Senior Systems Alchemist      Play: zen@shangri-la.dropbear.id.au
 //__     Computer Science, RMIT 	 WWW: http://www.cs.rmit.edu.au/~zen