Hi All:<br><br>I have a customized page template product which subclasses from ZopePageTemplate. In this product class, I have a method that redirects to a certain fixed page that I have created in the ZMI. One of the objects of this type makes calls to this method and also has some conditional redirects (based on certain request variables). Here is a representation<br>
<br>In my Product class, I have a method which conditionally redirects ...<br><br>def check_and_redirect(self):<br> request = self.REQUEST<br> if request.get('redirect_to_fixed_page', False):<br> request.RESPONSE.redirect('<a href="http://somefixedurl_in_my_domain">http://somefixedurl_in_my_domain</a>')<br>
<br>def getValue(self):<br> self.check_and_redirect()<br> # do some more stuff<br> ....<br> ....<br> return 'some value'<br><br>My ZPT looks like this ...<br>...<br><tal:call tal:define="data python:mytemplate.getValue()"/><br>
...<br>...<br>...<br>...<br><tal:redir tal:condition="python:here.REQUEST.has_key('var')"><br><tal:dummy tal:define="test python:here.REQUEST.RESPONSE.redirect('<a href="http://someotherurl">http://someotherurl</a>")"/><br>
</tal:redir><br>...<br>...<br>...<br><br><br>What is happeninig is that the redirect in the PT is taking precedence over my redirect (which Im doing in the method). My question is: Can I make sure that my redirect takes precedence without modifying the PT itself. Is there any other ZopePageTemplate method which I can patch so that my own redirect kicks in first??<br>
<br>Thanks for you time and help.<br><br>-AK<br>