-
-
Save howardgrigg/46e7fd9065e3c173aa8e 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
function getCMSFields() { | |
$f = new FieldList( | |
TextField::create('Title'), | |
HTMLEditorField::create('Content'), | |
$singleorshow = OptionsetField::create('SingleOrShow','Single Image or Slideshow?', singleton('PageSection')->dbObject('SingleOrShow')->enumValues()), | |
$single = DisplayLogicWrapper::create( | |
$image = UploadField::create('Image'), | |
$imageonleft = CheckboxField::create('ImageOnLeft', 'Tick for a vertical image format'), | |
$borderbottom = CheckboxField::create('BorderBottom', 'Tick for no padding below image') | |
), | |
$show = DisplayLogicWrapper::create( | |
$grid = GridField::create('Slides', 'Slideshow', $this->Slides(), GridFieldConfig_RelationEditor::create()) | |
) | |
); | |
$single->displayIf("SingleOrShow")->isEqualTo("Single"); | |
$show->displayIf("SingleOrShow")->isEqualTo("Slideshow"); | |
return $f; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment