[Zope] Get name of current method
Dieter Maurer
dieter@handshake.de
Sun, 4 Nov 2001 19:51:58 +0100
davelehman@loewen.com writes:
> When my "standard_html_header" method is called, I would like it to detect
> whether it's called on the site homepage or not.
The easiest way would be to put something like the following at the
top of your homepage (and only there):
<dtml-var "REQUEST.set('I_am_the_home',1)">
<dtml-var standard_html_header>
....
And in your "standard_html_header":
<dtml-if I_am_the_home>
....
</dtml-if>
When you are interested in properties of the published object,
you can use "PUBLISHED_OBJECT" (a REQUEST variable).
Be careful, "id" is sometimes an attribute but often a method.
It would be best to use "_.render(PUBLISHED_OBJECT.id)"
to access it.
Dieter