This site has been archived. To learn more about our current products Ibexa Content, Ibexa Experience, Ibexa Commerce head over to the Ibexa Developer Portal

eZ Community » Forums » General » Disable redirect after save in backend?
expandshrink

Disable redirect after save in backend?

Disable redirect after save in backend?

Friday 02 December 2011 2:48:58 pm - 6 replies

Hi,

when I save an object (aka "send for publishing"blunk.gif Emoticon, I'm redirected one node up. The editorial team would prefer to return to the saved object page after all content/edit/ actions.

Is there any way to configure this?

Friday 02 December 2011 3:28:47 pm

Hi Jens,

somewhere during the edit process, add a hidden input named "RedirectURIAfterPublish" with the URI you would like to be redirected to as the value.

I haven't tested it, but overriding design/admin2/templates/node/view/full.tpl and adding this code near the edit button will do the trick.

 <input name="RedirectURIAfterPublish" value={$node.url_alias|ezurl()} type="hidden" />

Hope this helps

Friday 02 December 2011 3:36:35 pm

Hello Jens,

There is not setting to help you in this regard (though I agree with your team in the type of redirection they prefer here and I actually think this should be a default setting feature by default :\).

 

You can have your eZ Publish website developer create template overrides which include a hidden html form element with a redirect uri. In this way you can return to the node via redirection after you leave the edit module view of the node your editing.

 

I've done this lots of time to make the admin more user friendly and it's worked great for year upon years.

Here are some brief examples of this feature available on ezpedia,

http://ezpedia.org/ez/discussions/discussion/content_language_and_redirection_post_variable_cheatsheet_documentation

 

The keys here are the following

{def $discardRedirectNode=fetch( 'content', 'node', hash( 'node_id', $main_node_id ) )
$publishRedirectNode=fetch( 'content', 'node', hash( 'node_id', $object.main_node_id ) )} 
<input type="hidden" name="RedirectURIAfterPublish" value="{$publishRedirectNode.url}" />
<input type="hidden" name="RedirectIfDiscarded" value="{$discardRedirectNode.url}" />
<input class="button" type="submit" name="DiscardButton" value="{'Discard'|i18n('design/base')}" /> 
<input type="hidden" name="DiscardConfirm" value="0" /></span>

 

I hope this helps ...

 

Cheers,

Heath

Modified on Friday 02 December 2011 3:37:20 pm by // Heath

Friday 02 December 2011 3:52:02 pm

Hi Jens,

somewhere during the edit process, add a hidden input named "RedirectURIAfterPublish" with the URI you would like to be redirected to as the value.

I haven't tested it, but overriding design/admin2/templates/node/view/full.tpl and adding this code near the edit button will do the trick.

 <input name="RedirectURIAfterPublish" value={$node.url_alias|ezurl()} type="hidden" />

Hope this helps

When creating an object for the first time there is no $node. Only after publish node is created.

So the solution is to have a RedirectURIAfterPublish url based on object id, eg. with http://projects.ez.no/redirect2

Friday 02 December 2011 3:53:16 pm

Thanks guys - you rock!!

Or as my collague Tina from the editorial team just said: "geil!" blunk.gif Emoticon 

(This means she's very happy and relieved in german)

Friday 02 December 2011 4:07:20 pm

Hi Jens,

somewhere during the edit process, add a hidden input named "RedirectURIAfterPublish" with the URI you would like to be redirected to as the value.

I haven't tested it, but overriding design/admin2/templates/node/view/full.tpl and adding this code near the edit button will do the trick.

 <input name="RedirectURIAfterPublish" value={$node.url_alias|ezurl()} type="hidden" />

Hope this helps

When creating an object for the first time there is no $node. Only after publish node is created.

So the solution is to have a RedirectURIAfterPublish url based on object id, eg. with http://projects.ez.no/redirect2

Good point !

Friday 02 December 2011 5:29:34 pm

Hello,

 

I think the template I would recommend trying to override (and add the hidden form fields) was, https://github.com/ezsystems/ezpu.../standard/templates/content/edit.tpl
Apologies I did not have time to test this to validate this suggestion this morning. This comes mearly from memory.

 

Best wished to your team. Enjoy the improved redirection happy.gif Emoticon

 

Cheers,

Heath 

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from