Forums / Developer / Redirect after delete?

Redirect after delete?

Author Message

Eric Weik

Friday 18 February 2005 8:28:20 am

Does anyone know of a way to redirect after deleting a content object?

For most "edit" forms you can use:

<input type="hidden" name="RedirectURI" value={concat('content/view/full/',$object.main_node_id)|ezurl} />

OR if you need to specify the URI from a step prior to the edit form you can use:

<input type="hidden" name="RedirectURIAfterPublish" value={concat('content/view/full/',$node.node_id)|ezurl} />

However, neither of these work after deletion.

After poking around a bit, I see some checks for "RedirectIfDiscarded", but these look like they are for discarding a draft. I want to actually redirect after deleting an object that is in the node tree.

Any ideas?

Lazaro Ferreira

Friday 18 February 2005 9:25:29 am

Hi,

It seems like there isn't an out-the-box parameter like this to redirect after object deletion, normally you can't remove an object from edit page, you can only store or discard the draft of the object

You can remove or delete the object from view full or as part of the view full of its container, ezpublish will redirect to a delete confirmation page after you click on delete button, then ezp will internally redirect to the view of the container node

So it seems like there isn't a simple way of doing it (without some programming)

Lazaro
http://www.mzbusiness.com

Eric Weik

Friday 18 February 2005 1:34:12 pm

Hi Lazaro,

I am trying to delete from full view (not an edit view), but my problem is that I'm trying to delete a child of a child (this is for a user-editable imaging application).

The application involves a a "Big Box" that contains a series of "Little Boxes", each of which contains a series of "Widgets". "Big Box" calls the line view of of "Little boxes", each of which call the line view of their "Widgets". The line view of the "Widgets" have "edit" and "delete" buttons. These work fine, but after deleting a "Widget", you end up looking at a "Little Box" full view. I'm trying to keep the user in the "Big Box".

This model is great for making an easy-to-use user interface, but has proved problematic for both deletion and view-caching (I've yet to figure out a way to make adding Widgets to Little Boxes properly update the Big Box view).

Anyhow, should anyone else encounter this problem, my solution for now is to use the "Redirect Operators" contribution. Because my Little Boxes are always visible from Big Boxes, there is no need for the user to EVER see the full-view of a Little Box, so it redirects to back to the Big Box full view.

http://www.ez.no/community/contribs/template_plugins/redirect_operators

I've also entered this as a "new enhancement" request:
http://ez.no/bugs/view/6229

-Eric