[Zope] Passing "error" variable to another page template?

Peter Bengtsson peterbe at gmail.com
Mon Oct 25 08:03:36 EDT 2004


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 at 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 at 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


More information about the Zope mailing list