I have several places where the DTML used to look like this:: <dtml-call "IfNotLoggedInRedirectSomewhere()"> The equivalent in TAL would be what? My current implementation is:: <span tal:define="dummy here/IfNotLoggedInRedirectSomewhere" tal:replace="nothing"></span> There must be a more good looking solution other than rewriting the whole way the site works. Peter
--On Donnerstag, 10. Juli 2003 18:23 Uhr +0100 Peter Bengtsson <mail@peterbe.com> wrote:
I have several places where the DTML used to look like this::
<dtml-call "IfNotLoggedInRedirectSomewhere()">
The equivalent in TAL would be what?
My current implementation is::
<span tal:define="dummy here/IfNotLoggedInRedirectSomewhere" tal:replace="nothing"></span>
There must be a more good looking solution other than rewriting the whole way the site works.
Shorter: <span tal:define="dummy here/IfNotLoggedInRedirectSomewhere" /> -aj
On Thu, 10 Jul 2003 18:23:52 +0100 GMT (..19:23 where i live(GMT+2) ) Peter Bengtsson asked the Zope mailinglist about the following:
I have several places where the DTML used to look like this::
<dtml-call "IfNotLoggedInRedirectSomewhere()">
The equivalent in TAL would be what?
My current implementation is:: <span tal:define="dummy here/IfNotLoggedInRedirectSomewhere" tal:replace="nothing"></span>
There must be a more good looking solution other than rewriting the whole way the site works.
slightly more good looking : <tal:redirect define="dummy here/IfNotLoggedInRedirectSomewhere" /> :) -- Geir Bækholt
slightly more good looking :
<tal:redirect define="dummy here/IfNotLoggedInRedirectSomewhere" />
That's probably what I was looking for. Thank you. However, it appears that if you do it this way where a variable is expected to be defined ('dummy' in this case) if you script does do a redirect it'll need a lock=1 argument and the URL in the addressfield doesn't match what you see on the screen. What I went for instead was: <span tal:condition="here/IfNotLoggedInRedirectSomewhere"> </span> Peter
<span tal:condition="here/IfNotLoggedInRedirectSomewhere"> </span>
Of course to shorten up your markup, you could also do: <span tal:condition="here/IfNotLoggedInRedirectSomewhere" /> Andy
Peter
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
On Thu, 10 Jul 2003 19:15:26 +0100 GMT (..20:15 where i live(GMT+2) ) Peter Bengtsson said the following:
What I went for instead was:
<span tal:condition="here/IfNotLoggedInRedirectSomewhere"> </span>
Agree on condition rather than define. I'd still reccommend using the tal-namespace, just to keep it pretty: <tal:somethingdescriptive condition="here/IfNotLoggedInRedirectSomewhere" /> ;) -- Geir Bækholt
participants (4)
-
Andreas Jung -
Andrew Altepeter -
Geir Bækholt -
Peter Bengtsson