[ZPT] global variables and ZPT

Schmidt, Amy ASchmidt@arn.com
Thu, 1 Nov 2001 14:36:55 -0500


Hi all,
First a quick thanks to Evan for making this list such a great resource.
Hopefully, I will soon gain enough knowledge about ZPT to post an answer
intstead of a question. Anyway... here's my latest dilemma.

I have a main page template that contains references to other page
templates. So my main page template is basically a container page and the
referenced page templates are child pages. I need to set a variable in the
container page that can be accessed by its children. I understand that I can
access a variable when I know the id of the containing page, for example, in
a child I can reference it's title with the following:
<span tal:define="global parenttitle [insertpageidhere]/title"
tal:replace="nothing" />

But I don't want to hardcode the pageid into my child page - the child might
be called by any number of container pages. So, finally... here's my
question - is there any way to get the object id of the containing page
dynamically? I have tried various syntaxes using REQUEST.PARENTS with no
luck in getting the id of the page that called the current page. 

Thanks, AMY

amy schmidt
interactive programmer
arnoldworldwide