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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Save and save and publish


Reply


4 Posts   872 Views

Avatar
bebabeba

Community Member, 193 Posts

7 July 2010 at 7:15pm

Hi!
I need to intersept the exact poin wich my page is save (for draft site) ans save and publish (for published site). Where are this function?
How my page.php call this?

Thanks!

Avatar
bebabeba

Community Member, 193 Posts

9 July 2010 at 3:37am

help..
I need intercpt save draft site to add that in an other point of my page..

Avatar
Tonyair

Community Member, 81 Posts

9 July 2010 at 5:51am

This is for StaffPage, for the Page is the same

$new = new StaffPage(); // Create new staff page      
$new->populateDefaults(); // if defaults are set
$new->setParent($_POST['ID']); // set parent page
$new -> update(
      array(
         'MenuTitle' => $title,
         'Title' => $title,
         'Locale' => $_POST['Locale'],
         'PhotoID' => $image->ID // adding image
      )
   );
$new->writeToStage('Stage'); // Save Page

Avatar
TotalNet

Community Member, 181 Posts

9 July 2010 at 10:10am

Have you tried onBeforeWrite?
http://doc.silverstripe.org/datamodel#onbeforewrite