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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 19 2025 01:12:25
Script start
Timing: Jan 19 2025 01:12:25
Module start 'layout'
Timing: Jan 19 2025 01:12:25
Module start 'content'
Timing: Jan 19 2025 01:12:26
Module end 'content'
Timing: Jan 19 2025 01:12:26
Script end

Main resources:

Total runtime0.5951 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 589.1563152.6250
Module start 'layout' 0.00560.0024 741.781339.4453
Module start 'content' 0.00800.5854 781.2266534.3594
Module end 'content' 0.59330.0017 1,315.58598.1641
Script end 0.5950  1,323.7500 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.6144160.0002
Check MTime0.00150.2458160.0001
Mysql Total
Database connection0.00070.124510.0007
Mysqli_queries0.545691.6874540.0101
Looping result0.00050.0840520.0000
Template Total0.567895.420.2839
Template load0.00200.330720.0010
Template processing0.565895.083320.2829
Template load and register function0.00020.029210.0002
states
state_id_array0.00070.118510.0007
state_identifier_array0.00070.113120.0003
Override
Cache load0.00180.3091140.0001
Sytem overhead
Fetch class attribute can translate value0.00060.098620.0003
Fetch class attribute name0.00120.204540.0003
XML
Image XML parsing0.00500.846820.0025
class_abstraction
Instantiating content class attribute0.00000.001240.0000
General
dbfile0.00470.7868220.0002
String conversion0.00000.001240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 10
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs