/** * updateCMSFields * * @return $fields */ public function updateCMSFields(Fieldlist $fields) { if ($this->owner->ShowCarousel) { $carousel_table = GridField::create('CarouselElements', false, $this->owner->CarouselElements()->sort('Sort ASC'), GridFieldConfig_RecordEditor::create()); $fields->addFieldToTab('Root.Carousel', $carousel_table); } else { $fields->removeByName('CarouselElements'); } $fields->removeByName('ShowCarousel'); return $fields; }
public function updateCMSFields(Fieldlist $fields) { // If Users Requests Carousel On Page if ($this->owner->ShowCarousel) { // Create Add Image Button $add_button = new GridFieldAddNewButton('toolbar-header-left'); $add_button->setButtonName(_t('CarouselPage.ADDIMAGE', 'Add Image')); // Add Carousel Editor $grid_config = GridFieldConfig_RecordEditor::create()->removeComponentsByType('GridFieldAddNewButton')->removeComponentsByType('GridFieldFilterHeader')->addComponent($add_button); // Table to Display Current Carousel Images $carousel_table = GridField::create('CarouselElements', false, $this->owner->CarouselElements()->sort('Sort ASC'), $grid_config); // Creates a tab on CMS to manage Carousel on $fields->addFieldToTab('Root.' . _t('CarouselPage.CAROUSELTABLABEL', 'Carousel'), $carousel_table); } else { $fields->removeByName('CarouselElements'); } // By default carousel settings do not appear $fields->removeByName('ShowCarousel'); $fields->removeByName('CarouselWidth'); $fields->removeByName('CarouselHeight'); parent::updateCMSFields($fields); }
/** * @param FieldList $fields */ public function updateCMSFields(Fieldlist $fields) { $fields->addFieldsToTab('Root.Social', array(Textfield::create('FacebookLink', 'Facebook'), Textfield::create('TwitterLink', 'Twitter'), Textfield::create('InstagramLink', 'Instagram'), Textfield::create('GoogleplusLink', 'Google Plus'), Textfield::create('YoutubeLink', 'Youtube'), Textfield::create('LinkedinLink', 'LinkedIn'))); }
public function NewsletterForm() { $form = BootstrapForm::create($this, __FUNCTION__, FieldList::create(EmailField::create('Email', '')->setAttribute('placeholder', 'Email Address')), Fieldlist::create(FormAction::create('sendNewsletterForm', 'Sign Up')->setStyle('primary')))->setLayout('inline'); return $form; }
public function updateCMSFields(Fieldlist $fields) { $fields->addFieldsToTab('Root.Main', array(TextField::create('mSupplyEmail', 'mSupply Contact Email'), TextField::create('mSupplyNZPhone', 'mSupply NZ Contact Phone'), TextField::create('ContactFormEmail', 'Email For Contact Form'), TextField::create('NewsletterFormEmail', 'Email For Newsletter Sign Ups'))); }
/** * @param FieldList $fields */ public function updateCMSFields(Fieldlist $fields) { $fields->addFieldsToTab('Root.SiteNotice', array(TextField::create('SiteNotice', 'Site Notice'))); }
public function ContactForm() { $form = BootstrapForm::create($this, __FUNCTION__, FieldList::create(TextField::create('FullName', 'Full Name'), TextField::create('Phone', 'Phone Number'), TextField::create('Email', 'Email Address'), TextAreaField::create('Message', 'Message')), Fieldlist::create(FormAction::create('sendContactForm', 'Send Message')->addExtraClass('square-btn'))); return $form; }
public function CommentForm() { $form = BootstrapForm::create($this, __FUNCTION__, Fieldlist::create(TextField::create('Name', '')->setAttribute('placeholder', 'Name'), TextAreaField::create('Comment', '')->setAttribute('placeholder', 'Type You Comment Here')), FieldList::create(FormAction::create('handleComment', 'Post Comment')->setStyle('primary')->addExtraClass('btn square-btn')), RequiredFields::create('Name', 'Comment')); return $form; }