Forums / Developer / Control the behaviour of the Web Site Toolbar
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
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
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