Tuesday, February 5, 2008

Plone redirect to home folder after login

One way, but possibly not best way, to automatically redirect a user to their Member area, directly after login, is to customize login_success and put

<tal:block define="redirect python: here.portal_membership.getHomeUrl();
foo python: request.RESPONSE.redirect(redirect)" />

directly after <div tal:condition="not:isAnon">.

edit 22-05-2008:
A better way is to modify login_next.cpy to include this line:

# modified: set came_from to member's profile page
came_from = membership_tool.getAuthenticatedMember().absolute_url()

No comments: