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

eZ debug

Timing: Jan 30 2025 21:14:04
Script start
Timing: Jan 30 2025 21:14:04
Module start 'content'
Timing: Jan 30 2025 21:14:04
Module end 'content'
Timing: Jan 30 2025 21:14:05
Script end

Main resources:

Total runtime0.2157 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0095 588.0469370.2891
Module start 'content' 0.00950.0137 958.33591,005.6719
Module end 'content' 0.02320.1924 1,964.00783,894.7422
Script end 0.2156  5,858.7500 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00462.1137200.0002
Check MTime0.00130.6088200.0001
Mysql Total
Database connection0.00100.486410.0010
Mysqli_queries0.123957.45231410.0009
Looping result0.00140.64741390.0000
Template Total0.191888.910.1918
Template load0.00070.336710.0007
Template processing0.191188.601010.1911
Override
Cache load0.00050.224910.0005
Sytem overhead
Fetch class attribute can translate value0.00170.791510.0017
XML
Image XML parsing0.00020.092210.0002
General
dbfile0.00934.3115200.0005
String conversion0.00000.003130.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs