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

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 16:07:54
Script start
Timing: Jan 18 2025 16:07:54
Module start 'layout'
Timing: Jan 18 2025 16:07:54
Module start 'content'
Timing: Jan 18 2025 16:07:55
Module end 'content'
Timing: Jan 18 2025 16:07:55
Script end

Main resources:

Total runtime0.6566 sec
Peak memory usage4,096.0000 KB
Database Queries65

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0046 589.1641152.6406
Module start 'layout' 0.00460.0035 741.804739.4766
Module start 'content' 0.00810.6470 781.2813599.0156
Module end 'content' 0.65510.0015 1,380.296912.1250
Script end 0.6566  1,392.4219 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.4851160.0002
Check MTime0.00140.2078160.0001
Mysql Total
Database connection0.00070.102910.0007
Mysqli_queries0.597791.0206650.0092
Looping result0.00070.1028630.0000
Template Total0.629395.820.3146
Template load0.00200.306920.0010
Template processing0.627295.525320.3136
Template load and register function0.00020.033210.0002
states
state_id_array0.00050.081810.0005
state_identifier_array0.00060.097820.0003
Override
Cache load0.00170.2635290.0001
Sytem overhead
Fetch class attribute can translate value0.00080.122630.0003
Fetch class attribute name0.00250.379870.0004
XML
Image XML parsing0.00150.223930.0005
class_abstraction
Instantiating content class attribute0.00000.002370.0000
General
dbfile0.00100.1447230.0000
String conversion0.00000.001440.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
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 19
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs