Hello, 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 it?? 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
Phil Bradbury wrote at 2003-5-22 16:04 +0100:
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 it??
"SESSION.set(key,value)" is the primary way. In ZPT, it will look like <XXXX tal:define=" dummy python:request.SESSION.set(key,value); ... "
in DTML: <dtml-call expr="SESSION.set(key,value)"> Dieter
participants (2)
-
Dieter Maurer -
Phil Bradbury