[Zope] Acquiring  root index_html method in lower level folder

Bruce Elrick belrick@home.com
Tue, 02 Nov 1999 17:03:47 -0700


Milt Martin wrote:
> 
> yes, they are dtml methods...
> as a newbie, i have not figured out why to use documents yet...
> 
This is what I have and it works as expected:

root
  index_html (DTML Method)
           (uses <dtml-var body>, <dtml-var mainmenu>,
            <dtml-var standard_html_header>...)
  body (DTML Method)
       (contains general site welcome text)
  mainmenu (DTML Method)
           (traverses objectValue(['Folder', 'DTML Document',
            'Squishdot Site']) to produce submenus and uses
            the Breadcrumbs code to enhance navigation)
  Graphics (Folder)
           (contains images for the site)
     various image files
  Lessons (Folder)
     body (DTML Method)(describes the lesson area)
     Lesson1 (DTML Document)(Straight HTML lesson on using Linux)
  Personnel (Folder)
     body (DTML Method) (Describes the Personnel part of the site)
     Add (Folder)
       Address (Folder)
         Home (Folder)
         Office (Folder)
         Worksite (Folder)
       PhoneNumber (Folder)
     Show (Folder)
     ...
etc...

The index_html is acquired everywhere from the root folder, as is the mainmenu
method. Anywhere I put a body method, different body text shows up, for
example .../Personnel/index_html shows Personnel's own body text.  Through the
wonders of acquisition, .../Personnel/Add/index_html shows Personnel's body
text (until I choose to replace it by creating a body DTML method in
Personnel/Add/).  The index_html includes image links using <dtml-var
"PARENTS[-1].Graphics.logo_200x48_png">; I avoid using aquisition because then
browsers don't realize that the graphics they see are the same (i.e. they
don't use cached versions)

Anyway...near as I can tell, I am doing the same thing you are and it
works...maybe you can see a difference that is the cause of your problems,
though.

Cheers...
Bruce

> -----Original Message-----
> From: Bruce Elrick <belrick@home.com>
> Date: Tue, 02 Nov 1999 14:30:13 -0700
> Subject: Re: [Zope] Acquiring  root index_html method in lower level
> folder
> 
> > Milt Martin wrote:
> > >
> > > >From a Zope newbie...
> > > Given:
> > > "root" folder
> > >         index_html method which refers to menu_bar and body_content
> >                       ^^^^
> > are you sure that index_html is a DTML method and not a DTML
> > document?  This
> > should work (and it does, because I do this), but only if index_html
> > is a
> > method, because when it is acquired by the "about" folder it takes on
> > the
> > context of the folder.  If index_html was a document, it has its own
> > context
> > when acquired and will pick up its methods from the origal location
> > (as you
> > seem to be experiencing).
> >
> >
> > >         menu_bar method
> > >         body_content method
> > >         "about" folder
> > >                 body_content method
> > >

--
Bruce Elrick, Ph.D.                       Saltus Technology Consulting Group
Personal: belrick@home.com                          IBM Certified Specialist
Business: belrick@saltus.ab.ca          ADSM, AIX Support, RS/6000 SP, HACMP