[Zope] Automatic inclusion help

Chris McDonough chrism@digicool.com
Tue, 01 Feb 2000 00:26:17 -0500


Yep, clearer, thanks...

How about this... create in each folder you publish (including the root
object), a method titled folder_specific_contents or something.  Then in
the root object's standard_html_header, call it.  What'll happen is
this:

If the root standard_html_header is this:

<html><head><title><dtml-var title_or_id></title></head>
Formatting placeholder.
<dtml-var folder_specific_contents>

And there's a folder named "stuff", within which is a method titled
"folder_specific_contents" which contains:

<h1>Hi, I'm folder specific contents of the <dtml-var title_or_id>
folder.</h1>
 
And the index_html of the stuff folder contains:

<h2>This is my body content</h2>

Calling /stuff from your web browser should show:

Formatting placeholder.
Hi, I'm folder specific contents of the stuff folder.
This is my body content.

Would this do it for you?  Note that you need to do nothing to the
content documents in each folder, you just need to make sure there's a
folder_specific_contents method defined in each folder.



"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?
> 
> On 01-Feb-2000 Chris McDonough wrote:
> > Maybe this question will clear this quesstion up for me... why wouldn't
> > you put a "custom" standard_html_header method into each differing
> > folder and just call that method in all your documents?  Why have a
> > 'folderid'_html_header?
> >
> > "M. Adam Kendall" wrote:
> >>
> >> So here's the situation..
> >> A client wants to automatically include a dtml method
> >> in all dtml documents inside any given folder.  So, using
> >> standard_html_header, I should be able to create some
> >> code to include 'folderid'_html_header.  Right?
> >> 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>
> >>      <dtml-comment> Object exists, render object </dtml-comment>
> >>      <dtml-var expr="_[customhead]">
> >>   <dtml-comment> End check </dtml-comment>
> >>   </dtml-if>
> >> <dtml-comment> End namespace injection </dtml-comment>
> >> </dtml-let>
> >>
> >> Any ideas?  Or am I going about it completely wrong?
> >>
> >> --
> >> M. Adam Kendall         |
> >> mak@kha0s.org           |  "There's never enough time to do
> >> http://kha0s.org        |  all the nothing you want."
> >>                         |   --Bill Watterson (Calvin and Hobbes)
> >>
> >> _______________________________________________
> >> 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 )
> >
> > --
> > Chris McDonough
> > Digital Creations, Inc.
> > Zope - http://www.zope.org
> >
> > _______________________________________________
> > 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 )
> 
> --
> M. Adam Kendall         |
> mak@kha0s.org           |  "There's never enough time to do
> http://kha0s.org        |  all the nothing you want."
>                         |   --Bill Watterson (Calvin and Hobbes)

-- 
Chris McDonough
Digital Creations, Inc.
Zope - http://www.zope.org