Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

implement 'Save and publish' button


Go to End


2 Posts   2114 Views

Avatar
bebabeba

Community Member, 193 Posts

14 October 2010 at 3:53am

Hi!
I need add a functionality in my admin CMS area when I click on 'save and published' button. I'm unable to find exact point and exact function. Help please..
For 'save' button I modifiy onBeforeWrite() function.
And How can I change messages after save?
Thanks

Avatar
swaiba

Forum Moderator, 1899 Posts

14 October 2010 at 4:05am

assuming you want to do something after the publish... this is what I'd start with...

in your data object override the publish function...

function publish($fromStage, $toStage, $createNewVersion = false) 
{
   parent::publish($fromStage, $toStage, $createNewVersion);
   
   //do stuff
}