I need a transparent redirection from one folder to another, to allow for proper bookmarking. Basically, different "Departments" have different points in a document tree, all keyed on a querystring variable. i.e. "docTree/index_html?dept=4" gives you accounting "docTree/index_html?dept=7" gives you IT Now, we want to give areas that don't have a homepage the ability to use this system as their homepage. That is "/department/accounting" gives you "docTree/index_html?dept=4". But, we want the URL to stay on the first visit as "/department/accounting". This will allow for users to stick the original URL in their bookmarks list. I found some good information on Zope.org, which gave me this code <!--#call "RESPONSE.setBase('http://www.mydomain.com/target_folder')"--> <dtml-with target_folder> <dtml-var index_html> </dtml-with> However, this code does not allow me to use the querystring ("?dept=4"). Can anyone reccomend how I can do this with DTML, or recommend an alternative solution. Edward
Edward Pollard wrote:
<!--#call "RESPONSE.setBase('http://www.mydomain.com/target_folder')"-->
<dtml-with target_folder> <dtml-var index_html> </dtml-with>
However, this code does not allow me to use the querystring ("?dept=4").
There are several ways, for instance <dtml-with target_folder> <dtml-let dept=4> <dtml-var index_html> </dtml-let> </dtml-with> See for instance Dieter Maurer's nice texts around http://www.handshake.de/~dieter/pyprojects/zope/book/chap3.html#c37ac15c14b5 for an explanation, also the online help in the ZMI. These are quite helpful things to know, so I recommend further reading. HTH, oliver
Thanks for the reply Oliver. I'll confess up front that my study of DTML has taken a backseat to my quest for Page Template and Python understanding. However, in regards to your response, this does not seem to work. Certainly, the page I'm redirecting to does not see the dept value in "request/dept" (which is where it has been looking). As a quick test, I tried redirecting to a DTML document, and even then <dtml-var dept> did not work in the redirected page. Can you provide more insight as to what I should be doing here? Edward Oliver Bleutgen wrote:
Edward Pollard wrote:
<!--#call "RESPONSE.setBase('http://www.mydomain.com/target_folder')"-->
<dtml-with target_folder> <dtml-var index_html> </dtml-with>
However, this code does not allow me to use the querystring ("?dept=4").
There are several ways, for instance <dtml-with target_folder> <dtml-let dept=4> <dtml-var index_html> </dtml-let> </dtml-with>
See for instance Dieter Maurer's nice texts around http://www.handshake.de/~dieter/pyprojects/zope/book/chap3.html#c37ac15c14b5
for an explanation, also the online help in the ZMI. These are quite helpful things to know, so I recommend further reading.
HTH, oliver
participants (2)
-
Edward Pollard -
Oliver Bleutgen