[Zope3-Users] passing data to nextURL()

Rupert Redington rupert at neontribe.co.uk
Wed Jan 25 10:43:23 EST 2006


I'm currently writing a blogging application in zope3, and enjoying the
learning curve after some years working with zope/plone.

I need for users to add comments to items (so I've got a content class
and the requisite browser:addform entries etc) all of which works fine.

My problem is that after adding a comment users are returned to a view
of the container to which the comment was added, whilst on the whole
I'll want them to return to the location they were at when they hit an
add-comment link.

my links are (currently) of the form:

http://localhost:8090/testblog/testpost/+/action.html?type_name=AddComment.html

and in this instance I'd want them to return to:

http://localhost:8090/testblog

But sadly for me the return url won't always be in the containment
hierarchy (imagine adding a comment to an aggregated page showing posts
from several blogs and returning to that aggregator rather than to the
blog which is the parent of the post commented on).

I can affect this behaviour to some extent using nextURL() but the best
I can manage is to construct a nextURL which is in some way connected to
the comment's location. (using Stephan's post to this list
http://www.mail-archive.com/zope3-users@zope.org/msg01048.html )

So far attempts to use the HTTP_REFERER from the request headers have
failed since by the time nextURL comes into play the trail has gone cold.

In what way (or ways) am I being wrongheaded and what would be a
zope3ish solution to this case?

Cheers,

Rupert



More information about the Zope3-users mailing list