[Zope] Using REQUEST only in a limited fashion

Anders Schneiderman schneida@seiu.org
Sat, 07 Jul 2001 11:38:55 -0400


I want to create a standard index page that can be easily overridden.  I've 
set up index_html to point to standard_index, which looks like this:
-------------------------------------------------------------------------------------
<dtml-var standard_html_header>
<dtml-with portal_properties>


<dtml-if front_page>
    <dtml-var front_page>
<dtml-else>
    <font size="+1">Click on the item you wish to view:</font>
    <dtml-var liststuff>
</dtml-if>

</dtml-with>
<dtml-var standard_html_footer>
---------------------------------------------------------------------------------

This works fine except for an obvious problem.  Let's say I'm in the 
healthcare/nurses folder.  If the healthcare folder contains the front_page 
Method, then healthcare/nurses will end up using it too.  I don't want that 
to happen; I only want to show front_page in a folder that contains 
it.   How do I do that?

I could use REQUEST only, but so far I haven't figured out how.  Is there a 
way to put it into the dtml-if statement?  The only examples I could find 
on the Zope site used <dtml-with REQUEST only>, but that will cause the 
call to <dtml-var liststuff> to blow up because it's only looking in the 
requesting folder.  What's the best way around this?  And if it's too much 
of a pain to do in a DTML Method, how about in Python?

Thanks,
Anders Schneiderman
Information Manager
SEIU International

P.S.  Part of the reason I want to figure this out is that I'm going to 
elaborate on this scheme.  For example, I'm going to add some code to 
standard_index so that if the requesting folder contains a  DTML Method 
called "blurb", it'll display the blurb followed by the list of files.  In 
short, I want to create several ways of letting users customize a 
particular folder's display depending on their level of skill.