On 7/19/05, Erik Myllymaki <[EMAIL PROTECTED]> wrote: > I use the following template often. When using a page template for my MAIN > page, > I access the error and message vars with: > > <p tal:content="options/error">Error message</p> > <p tal:content="options/message">Reg. Message</p> > > How would I access them when I use a dtml-method for my MAIN page? > <dtml-var error> and <dtml-var message> don't seem to work. >
That _should_ work. In DTML, I think when you ask for something it does a options, REQUEST, context, acquisition context lookup all in one loop. In TAL you can't be lazy :( and you have to specify exactly where you expect it to come from. Bare in mind that keyword arguments only span across ONE template where as variables in REQUEST span across ALL templates. Doublecheck your template usage and/or send us your traceback. > Python Script - index_html: > > # Import a standard function, and get the HTML request and response objects. > from Products.PythonScripts.standard import html_quote > request = container.REQUEST > RESPONSE = request.RESPONSE > > error='' > message='' > > if not request.has_key('next_state'): > return container['MAIN'](context, request, error=error, message=message) > > elif request.get('next_state') == 'Do Something': > try: > doSomething() > message = message + 'We did something' > except: > error = error + 'Error in doSomething()' > > > elif request.get('next_state') == 'Do Something Else': > try: > doSomethingElse() > message = message + 'We did something else' > except: > error = error + 'Error in doSomethingElse()' > > > return container['MAIN'](context, request, error=error, message=message) > > _______________________________________________ > 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, work www.fry-it.com home www.peterbe.com hobby www.issuetrackerproduct.com _______________________________________________ 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 )