Custom CMSB - SAVE and then REDIRECT button

4 posts by 2 authors in: Forums > CMS Builder
Last Post: June 10, 2011   (RSS)

Re: [rjbathgate] Custom CMSB - SAVE and then REDIRECT button

By Jason - June 9, 2011

Hi Rob,

The easiest thing to do would be to not actually change any of the CMSB code, but to write a plugin that does the redirect. If you use the hook record_postsave, which is executed after the save is completed, you can check for the name of your button in the $_REQUEST array. If it's there, that means your custom button was clicked. You can then use the redirectBrowserToURL(); function to redirect to any URL you want.

Hope this helps get you started.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Custom CMSB - SAVE and then REDIRECT button

By rjbathgate - June 9, 2011

Hi Jason,

Thanks heaps for the reply.

I have achieved it by setting a cookie onclick of the button, and the post save, if the cookie exists, it redirects (and then clears the cookie).

I have done it directly in CMSB code, but I want to/will turn it into a plugin someday!

Thanks

Re: [rjbathgate] Custom CMSB - SAVE and then REDIRECT button

By Jason - June 10, 2011

Hi,

Glad to hear that you got that working. It is important to note, however, that if you upgrade your copy of CMS Builder, your code changes will be overwritten. So a plugin would be the best long term solution.

Let us know if you have any other questions.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/