Passing "error" variable to another page template?
I'd like to use a tal:on-error clause to render an error message that includes the contents of the "error" variable, and I'm at a loss as to how to go about that. I guess that a more general form of the question would be, how do I pass variables to page templates? -- Kirk Strauser The Day Companies
You pass variables to page templates with keyword arguments. So for example, from a python script:: if context.LoggedIn(): return context.User(context, context.REQUEST) else: return context.User(context, context.REQUEST, error="Not logged in") Later in you template you do this:: <span tal:condition="options/error|nothing"> Error: <br tal:replace="options/error" /> </span> Good luck On Fri, 22 Oct 2004 12:51:02 -0500, Kirk Strauser <kirk@daycos.com> wrote:
I'd like to use a tal:on-error clause to render an error message that includes the contents of the "error" variable, and I'm at a loss as to how to go about that. I guess that a more general form of the question would be, how do I pass variables to page templates? -- Kirk Strauser The Day Companies _______________________________________________ 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 )
-- Peter Bengtsson, http://www.peterbe.com
participants (2)
-
Kirk Strauser -
Peter Bengtsson