Forums / Setup & design / redirecting after content publishing

redirecting after content publishing

Author Message

Nicolas Heiringhoff

Wednesday 28 April 2004 4:42:58 am

We want to do a redirect after publishing a new object of a class, like a new guestbook entry in the TSCM page for example. We know that we can hardwire the redirect with the following code to a specific node (56) in our case.

    <input type="hidden" name="RedirectURI" value={"content/view/full/56"} />

In the TSCM example you get a redirect to a list of all guestbook entries (after the entry has been aproved by the admin of course). If you click on an entry in that list, you get the "full view" of that entry.

We want to redirect the user directly to the "full view" of the newly generated entry (the aproving of the admin does not matter in our case)
So we must replace the hardwired node 56 by the node_id of the just generated object. We have looked in the content/edit_attribute.tpl and in the content/edit.tpl templates, but we can not find the code which gives us the id, which is assigned to the newly generated object.

any help is welcome!

http://www.heiringhoff.de

Sylvain Bannier

Friday 01 December 2006 9:08:48 am

Not actually related to you question,
but you should now use "RedirectURIAfterPublish" instead of "RedirectURI", don't you think ?

http://www.smile.fr

Thiago Campos Viana

Tuesday 26 June 2007 1:06:27 pm

I've used this code:

{if eq($object.status, '0')}
<input type="hidden" name="RedirectURIAfterPublish" value={concat( "content/versionview/", $object.id,"/", $object.current_version )} />
{else}
<input type="hidden" name="RedirectURIAfterPublish" value={concat( "content/view/full/", $object.main_node_id )} />
{/if}

eZ Publish Certified Developer: http://auth.ez.no/certification/verify/376924

Twitter: http://twitter.com/tcv_br