Created
May 1, 2013 14:56
-
-
Save ss23/5495755 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class HomePage extends Page { | |
public static $db = array( | |
); | |
public static $has_one = array( | |
); | |
public static $has_many = array('Images' => 'Image'); | |
public function getCMSFields() { | |
$fields = parent::getCMSFields(); | |
$gridFieldConfig = GridFieldConfig_RelationEditor::create(); | |
$gridFieldConfig->getComponentByType('GridFieldAddNewButton')->setButtonName('Add New Image'); | |
$gridField = new GridField("Images", "Images", $this->Images(), $gridFieldConfig); | |
$gridField->setRightTitle('Add images to the slider'); | |
$fields->addFieldsToTab('Root.Images', $gridField); | |
return $fields; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment