Forums / Setup & design / How can we get the object id?

How can we get the object id?

Author Message

Ralf Lohmann

Thursday 29 April 2004 5:56:39 am

On our page the user can create a new form (object of a class). After the user has filled out the data fields and pressed the submit button we want to redirect him to the values he just submited. We need the object id of the object he just created. How can we get the object id of the just generated object? We know that it is hidden in the code of the edit.tpl somewhere, but we don?t find it.

iddis GmbH
Gesellschaft für geteiltes Wissen
Society for shared knowledge
Falkstr. 73-77
47058 Duisburg
Germany

Thiago Campos Viana

Tuesday 26 June 2007 1:08:47 pm

you do not need the object id, you need to use the view versionview of the module content, so, you have just to know the object id.

I've used this code in the content/edit template, and this worked well:

{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