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

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 18 2025 11:42:57
Script start
Timing: Jan 18 2025 11:42:57
Module start 'layout'
Timing: Jan 18 2025 11:42:57
Module start 'content'
Timing: Jan 18 2025 11:42:58
Module end 'content'
Timing: Jan 18 2025 11:42:58
Script end

Main resources:

Total runtime0.6361 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 588.0313152.6406
Module start 'layout' 0.00530.0031 740.671939.4766
Module start 'content' 0.00840.6263 780.1484593.2734
Module end 'content' 0.63470.0014 1,373.421912.1406
Script end 0.6360  1,385.5625 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.4849160.0002
Check MTime0.00140.2125160.0001
Mysql Total
Database connection0.00060.102010.0006
Mysqli_queries0.589192.6138590.0100
Looping result0.00070.1131570.0000
Template Total0.603494.920.3017
Template load0.00200.318020.0010
Template processing0.601494.544020.3007
Template load and register function0.00010.014410.0001
states
state_id_array0.00140.220610.0014
state_identifier_array0.00090.139320.0004
Override
Cache load0.00170.2674220.0001
Sytem overhead
Fetch class attribute can translate value0.00050.083330.0002
Fetch class attribute name0.00120.182160.0002
XML
Image XML parsing0.00130.207230.0004
class_abstraction
Instantiating content class attribute0.00000.001260.0000
General
dbfile0.00100.1624270.0000
String conversion0.00000.001140.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
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
3content/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: 18
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs