We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Edit Link with Redirect after Editing

Development and Programming

jeremydouglas's avatar
jeremydouglas
292 posts
17 years ago
jeremydouglas's avatar jeremydouglas

Has anyone ever tried an extension for this…. ?

I often use an edit link with entries. The problem with that is when a user is used to editing from the frontpage, they are left in the control panel after editing the entry.

Has anyone made/can think of a way to give the user a link to go back to where they were on the front end after editing an entry?

I’m thinking I could use this hook - edit_entries_extra_actions ?

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
17 years ago
Mark Bowen's avatar Mark Bowen

I think you would need an extension for this but it would be quite a bit of work as you would need to say :

If user was sent to edit this post from a front-end template then when pressing save they get sent back to where they were before but if they came to edit this entry from the normal CP link then keep them in the CP.

The other problem you have is that if a user is sent to the CP to update an entry then they could possibly click anywhere they like and end up doing all sorts of things! 😊

I think you would be better off using a Stand-Alone Edit Form of some kind or another or perhaps some AJAX to update the entry from right there on the template page. There are quite a few threads in the forums about Stand-Alone Edit Forms and over at Solspace there is a form helper plugin which is made specifically for this purpose.

As to an AJAX solution I was sure I had seen one in the wiki at some point though I could be wrong but I’m sure that a search on the forums here should come up with something if you decide to go down that route instead.

Hope that helps?

Best wishes,

Mark

       
jeremydouglas's avatar
jeremydouglas
292 posts
17 years ago
jeremydouglas's avatar jeremydouglas

Thanks for the thoughts Mark, I’ve used the form helper often.

Problem is there are some extensions I’m using in the publish page that don’t work so well in a saef. I’m thinking this might be handy. Something like the live look, but doesn’t open a new browser window.

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
17 years ago
Mark Bowen's avatar Mark Bowen

HI Jez,

Hmm well in that case yes you would need an extension to do what you need but I don’t know where you would start in creating something that does what you need. Also looking at your first post you mentioned the edit_entries_extra_actions hook. I could be wrong but I don’t think that is the one that you would need in this case. I am pretty sure that just allows you to add extra options to the drop-down menu that appears at the bottom of the EDIT page which currently on a fresh install gives you the options to edit / delete entries.

As you are going to be sending people directly to the entry and into its entry / edit screen they wouldn’t really get to see that part of things. What you are going to need is something that fires when the user / client presses the Update button once they have finished with the entry and then they will get sent back (depending on where they came from in the first place) to the correct location.

Quite in-depth if you ask me but I would think possible, just don’t ask me to make the extension that handles this that’s all!! 😊 The only problem I see is where I mentioned before. If you are sending someone to the direct edit screen for an entry then they could theoretically click anywhere anyway such as the EDIT tab which would then muck your work-flow up.

Sorry I can’t be of more help but I think this would be one for the admins to have a ponder upon for you.

Just out of interest though what extensions are you using in the publish page that don’t work well with your SAEF. Maybe there is a way around those?

Best wishes,

Mark

       
jeremydouglas's avatar
jeremydouglas
292 posts
17 years ago
jeremydouglas's avatar jeremydouglas
I am pretty sure that just allows you to add extra options to the drop-down menu that appears at the bottom of the EDIT page which currently on a fresh install gives you the options to edit / delete entries.

Yes, you are right on that one. I think I misread that.

Extensions that I use in the Publish page… well the main one was this time around File by Mark Huot. I’ve had it working before on a saef, but now it’s not for me. I was runnin’ out of time on the job, so I went with links to the CP instead of making a saef.

Sometimes, for smaller jobs it’s easier to just put links to the cp. Though I do love it when I can do everything in a saef and not have to confuse people with the cp.

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
17 years ago
Mark Bowen's avatar Mark Bowen

Hi Jez,

If it is just a problem with the File upload extension then personally as this is more a work-flow kind of problem I would try and get the extension working again. Other than that can you not use the standard upload buttons that exist in the SAEF?

There are also about another 3 different extensions that allow file uploads in an SAEF too. If you check out the extensions forum then there was a new one not too long ago which for the life of me I can’t remember the name of at the moment.

Hope some of that helps?

Best wishes,

Mark

       
jeremydouglas's avatar
jeremydouglas
292 posts
17 years ago
jeremydouglas's avatar jeremydouglas

Thanks for all your help mark. Often I use the standard file upload feature. When I get a chance I’ll probably figure out how I had it working before on a saef.

Anywho, this has gone off-track from what I was originally wanting. I don’t see an extension hook to add to the “Entry Has Been Updated” success page. So, I guess that’s all I really needed to know.

Don’t really want to do any hacks for this.

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
17 years ago
Mark Bowen's avatar Mark Bowen

Hiya,

Yes the only hook that I can see is the submit_new_entry_end but what you really need is a edit_entry_end or something like that. Having said that one of the admins might know of something that could do this but I would tend to lean towards getting the SAEF to operate the way you want it to as this is a work-flow problem really.

Sorry I couldn’t be of more help on this one.

Best wishes,

Mark

       
Jamie Poitra's avatar
Jamie Poitra
409 posts
17 years ago
Jamie Poitra's avatar Jamie Poitra

submit_new_entry_end, despite the name, gets triggered on edits as well.

I think you might be able to make it happen selectively. You have the tracker array in the Session that can let you peak at were someone came from easily enough and then do the redirect based on that. This way if the person came from somewhere outside the CP you can return them there and if not let it redirect as it normally does.

EDIT: I would use the submit_new_entry_absolute_end hook instead.

Jamie

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
17 years ago
Mark Bowen's avatar Mark Bowen

Aha so the submit_new_entry_end is for both publish and edit then?

Should be possible then.

Best wishes,

Mark

       
Jamie Poitra's avatar
Jamie Poitra
409 posts
17 years ago
Jamie Poitra's avatar Jamie Poitra

Yeah, first time I ran into that I was all confused too. But it triggers in both instances. The function that gets called for updating changes is the same one that gets called for submitting new entries. Thus the confusing name.

Jamie

       
Simon Cox's avatar
Simon Cox
405 posts
17 years ago
Simon Cox's avatar Simon Cox
Has anyone made/can think of a way to give the user a link to go back to where they were on the front end after editing an entry?

Or you could open the link to the entry in a new page and shut the window after you have finished…

       
jeremydouglas's avatar
jeremydouglas
292 posts
17 years ago
jeremydouglas's avatar jeremydouglas

I’ve done that with a popup window. Quick easy fix for sites that don’t have much budget for development.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.