[Zope] Setting session vars from hyperlinks

Phil Bradbury phil.bradbury@man.ac.uk
Thu, 22 May 2003 16:04:18 +0100


Probably an easy solution but it is evading me.

I basically want to code some 'text only' and 'printer friendly' links at
the top of each page which, when clicked, will set a session variable
checked on the index_html page to determine which template to use for each
page. Is there a standard way to do this sort of thing, and if so what is

Do I need to direct the hyperlinks to a python script to set the session var
and then to redirect back to the initial page (this seems clumsy), or is
there some more elegant way?

I have currently defined a file with many macros in it and use this to build
up the current view by stipulating a layout and using the macros in the
relevant places. This template (called 'standard') is just 'directed to' by
the index_html file which is called whenever a navigation link is chosen.
The new index_html file would (I presume) simply check for the existence and
value of the session var and then decide which template to use based on
it.... I am unsure how to actually best set the session var in the first
place though!

Your help and comments would be appreciated!

Phil Bradbury