Forums / Developer / Control the behaviour of the Web Site Toolbar

Control the behaviour of the Web Site Toolbar

Author Message

Albe Terra

Thursday 31 July 2008 2:14:49 am

Hi!
I have a site with this structure:

Archive -> Document -> Attachment

Documents are sub-items of the Archive, and so are Attachments for Document.

If I create a Document with the Web Site Toolbar, by default, at the end of the operation, the system goes back to the parent node, so it goes back to the Archive.

I want to change this behaviour so that when I finish to create a Document, the system moves to the view of the new node I have just created, so showing me the new Document.

How can I do this?

Thanks

Albe Terra

Thursday 31 July 2008 6:49:02 am

I found an hidden element in the edit form called "RedirectURIAfterPublish"...I think that's what I was looking for!

The problem in now: how can I change this value only for one content class? So that when I edit instances of this class, the value is cutomized according to my needs.

Thanks! Albe

Gabriel Finkelstein

Thursday 31 July 2008 11:24:29 am

You could do an override of edit.tpl for that class and add that hidden field.
Something like:

[edit_document]
Source=content/edit.tpl
MatchFile=edit/document.tpl
Subdir=templates
Match[class_identifier]=document

André R.

Thursday 31 July 2008 12:12:03 pm

And since you don't have the node id before the object is published the first time, you'll need to create a module that takes object id as input and redirects you to the url of the main node of the object.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Albe Terra

Friday 01 August 2008 5:48:58 am

Thanks to all!

So I have to use the attribute "RedirectURIAfterPublish" to redirect the user to a custom module?

And how can I obtain the ID of the node when I'm in the module and make the redirection to the view of the node?

Thanks to all!
Albe

eZ debug

Timing: Jan 31 2025 00:38:56
Script start
Timing: Jan 31 2025 00:38:56
Module start 'content'
Timing: Jan 31 2025 00:38:56
Module end 'content'
Timing: Jan 31 2025 00:38:56
Script end

Main resources:

Total runtime0.1819 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.0075 588.0625370.2734
Module start 'content' 0.00760.0116 958.33591,005.7031
Module end 'content' 0.01910.1627 1,964.03913,894.2891
Script end 0.1819  5,858.3281 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00442.4392200.0002
Check MTime0.00150.8062200.0001
Mysql Total
Database connection0.00080.428710.0008
Mysqli_queries0.095552.51311410.0007
Looping result0.00160.86791390.0000
Template Total0.162389.210.1623
Template load0.00080.464010.0008
Template processing0.161588.764010.1615
Override
Cache load0.00060.343710.0006
Sytem overhead
Fetch class attribute can translate value0.00150.841710.0015
XML
Image XML parsing0.00020.118710.0002
General
dbfile0.00301.6723200.0002
String conversion0.00000.003830.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