I needed to accomplish this too, but didn't succeed by using existing functionality.
I made my own module which redirects to the main node of an object, by specifying the object id as a parameter in the URL. I've uploaded my extension to pubsvn, you can check it out from http://pubsvn.ez.no/community/trunk/extension/redirect.
Installation and use:
- enable the extension
- give your users access to the redirect module (assign them a role with a policy for function redirect of module redirect)
- you can use /redirect/mainnode/<i>yourobjectid</i> in the RedirectURIAfterPublish hidden input field. - custom view parameters are passed by in the URL, so you can use /redirect/mainnode/<i>yourobjectid</i>/(customkey)/customvalue.
The extension was created in April 2005, and hasn't been tested on more recent releases of eZ publish. Feel free to try it, I hope it solves your problem.
Kristof did you think about making a package and put it into Contrib section? Probably more users will need something similar, and not all users browsing pubsvn, now it is a bit hidden.
Adding the extension to pubsvn was the quickest way to get it to Maxime. I will make a package and add it to the contributions at ez.no as soon as I have some more time. I know I should do this for all my extensions on pubsvn...
hmm, i don't understand all this..isn't this extension used to redirect to the main node of a not yet existing object? in that case, where do i get the object id from?? should i use the powercontent extension?
Not yet published object (so it doesn't have a node id yet). Typically used from edit templates if you want to redirect to the node after the user publishes the object, indirectly via this extension.