public function getCMSFields() { $fields = parent::getCMSFields(); $fields->removeByName(array('SortOrder', 'Pic', 'UID')); $fields->addFieldsToTab('Root.Main', array(CheckboxField::create('Visible', _t('FacebookPost.VISIBLE', 'Is visible?')), DatetimeField_Readonly::create('Date', _t('FacebookPost.DATE', 'Posted on')), NumericField_Readonly::create('Likes', _t('FacebookPost.LIKES', 'Likes')), HtmlEditorField::create('Message', _t('FacebookPost.MESSAGE', 'Text'))->setRows(10))); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->removeFieldsFromTab('Root.Main', array('Title', 'Content', 'URLSegment', 'MenuTitle')); $fields->addFieldsToTab('Root.Main', array(HtmlEditorField::create('Content', 'Content'), HtmlEditorField::create('Content_cn', 'Content_cn'), UploadField::create('Images', 'Images', $this->Images())->setAllowedExtensions(array('jpg', 'jpeg', 'png', 'gif'))->setAllowedMaxFileNumber(5)->setFolderName('AboutImages')), 'Metadata'); return $fields; }
public function getCMSFields() { $return = parent::getCMSFields(); $return->addFieldsToTab('Root.Main', [new ColorPaletteField('BackgroundColor', $this->fieldLabel('BackgroundColor'), ['grey-light' => '#F6F6F6', 'white' => '#FFF', 'blue-dark' => '#015790'])], 'Content'); $return->addFieldToTab('Root.Main', HtmlEditorField::create('AfterContent', 'Text to appear after the sponsors')); return $return; }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->removeFieldsFromTab('Root.Main', array('Title', 'Content', 'MenuTitle')); $fields->addFieldsToTab('Root.Main', array(TextField::create('Title', 'Title'), TextField::create('Title_cn', 'Title_cn'), HtmlEditorField::create('Content', 'Content'), HtmlEditorField::create('Content_cn', 'Content_cn'), DateField::create('Date', 'Date')->setConfig('showcalendar', true)), 'URLSegment'); return $fields; }
/** * @param FieldList $fields * @return FieldList */ public function updateCMSFields(FieldList $fields) { $fields->removeByName('Content'); /** @var HtmlEditorField $content */ $fields->addFieldToTab('Root.Main', $content = HtmlEditorField::create('Content', _t('BoilerplatePageExtension.Content', 'Content')), 'Metadata'); $content->setRows(20); }
public function getCMSFields() { Requirements::css('widgetify/css/widgetify_cms.css'); Requirements::javascript('framework/thirdparty/jquery/jquery.js'); Requirements::javascript('widgetify/scripts/widgetify_page.js'); $fields = parent::getCMSFields(); $fields->push(HiddenField::create('WidgetifyContent', 'WidgetifyContent')); $fields->push(HiddenField::create('ThisID', 'ThisID', $this->ID)); $tab = $fields->findOrMakeTab('Root.Main'); $tab->insertAfter(HeaderField::create('WidgetifyTitle', 'Widgetify Template', 3), 'Metadata'); if (!$this->WidgetifyTemplateID) { $this->WidgetifyTemplateID = 0; } $templatesMap = DataList::create('WidgetifyTemplate')->map(); $tab->insertAfter(DropdownField::create('WidgetifyTemplateID', 'Select Template', $templatesMap)->setEmptyString('- Select -'), 'WidgetifyTitle'); $tab->insertAfter(CheckboxField::create('CSSFrontend', 'Apply template Stylesheet to front-end page'), 'WidgetifyTemplateID'); $tab->insertAfter(CheckboxField::create('JSFrontend', 'Apply template Javascript to front-end page'), 'CSSFrontend'); $tab->insertAfter(HeaderField::create('WidgetifyPreviewTitle', 'Widgetify Content', 3), 'JSFrontend'); $tab->insertAfter(LiteralField::create('WidgetifyPreview', '<div id="widgetifyPreview" class="widgetifyTemplate"></div>'), 'WidgetifyPreviewTitle'); $htmlField = HtmlEditorField::create('WidgetDynamicContent', false); $editorFieldContents = ' <div id="WidgetDynamicContentHolder" class="WidgetDynamicContentHolder"> <p id="edit-widget-title">Edit content</p>' . $htmlField->forTemplate() . ' <p class="widget-edit-actions"> <a href="javascript:;" id="save-widget-content" class="ss-ui-action-constructive ss-ui-button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary">Update</a> <a href="javascript:;" id="cancel-widget-content" class="ss-ui-action-destructive ui-button ui-widget ui-state-default ui-button-text-icon-primary ui-corner-left ss-ui-button">Cancel</a> </p> </div>'; $tab->insertAfter(LiteralField::create('WidgetDynamicContentPlaceHolder', $editorFieldContents), 'WidgetifyPreview'); $fields->removeFieldFromTab('Root.Main', 'Content'); return $fields; }
public function getCMSFields() { $fields = FieldList::create(TextField::create('Title'), HtmlEditorField::create('Description'), $uploader = UploadField::create('Photo')); $uploader->setFolderName('region-photos'); $uploader->getValidator()->setAllowedExtensions(array('png', 'gif', 'jpeg', 'jpg')); return $fields; }
/** * @return FieldList */ public function getCMSFields() { $fields = parent::getCMSFields(); $fields->push(TextField::create("Title")); $fields->push(HtmlEditorField::create("HTML", "Content")); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->removeFieldsFromTab('Root.Main', array('Content')); $fields->addFieldsToTab('Root.Main', array(TextField::create('PolicySummary', 'Policy Summary'), HtmlEditorField::create('PolicyDetail', 'Policy Detail'), UploadField::create('PolicyImages', 'Policy Images', $this->PolicyImages())->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png'))->setAllowedMaxFileNumber(6)->setFolderName('AboutPage'), TextField::create('RecipeSummary', 'Recipe Summary'), HtmlEditorField::create('RecipeDetail', 'Recipe Detail'), UploadField::create('RecipeImages', 'Recipe Images', $this->RecipeImages())->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png'))->setAllowedMaxFileNumber(6)->setFolderName('AboutPage'), TextField::create('ReputationSummary', 'Reputation Summary'), HtmlEditorField::create('ReputationDetail', 'Reputation Detail'), UploadField::create('ReputationImages', 'Reputation Images', $this->ReputationImages())->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png'))->setAllowedMaxFileNumber(6)->setFolderName('AboutPage')), 'Title'); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldsToTab("Root.Main", array(OptionsetField::create('Status', 'Status', array("1" => "Active", "0" => "Disabled"), 1), TextField::create('AdminTitle')->setDescription('This field is for adminisration use only and will not display on the site.'), TextareaField::create('Title', 'Title')->setRows(2), HtmlEditorField::create('Content', 'Content'))); $this->extend('updateCMSFields', $fields); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); $tinyMce = HtmlEditorField::create('Content', _t('TextBlock.CONTENT', 'Content')); $fields->addFieldToTab('Root.Main', $tinyMce); $this->extend('updateCMSFields', $fields); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->removeByName('OwnerID'); $fields->removeByName('ParentID'); $fields->addFieldsToTab('Root.Main', array(CheckboxField::create('Visible', _t('FacebookTimelinePic.VISIBLE', 'Is visible?')), HtmlEditorField::create('Caption', _t('FacebookTimelinePic.CAPTION', 'Message'))->setRows(10))); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->push(TextField::create("WidgetLabel", "Widget Label")); $fields->push(TextField::create("WidgetTitle", "Widget Title")); $fields->push(HtmlEditorField::create("WidgetContent", "Content")); return $fields; }
public function updateCMSFields(FieldList $fields) { $fields->addFieldToTab("Root", new Tab('CookiePolicy')); $fields->addFieldToTab('Root.CookiePolicy', CheckboxField::create("CookiePolicyIsActive")->setTitle(_t('CookiePolicy.ISACTIVE', "Is Active"))); $fields->addFieldToTab('Root.CookiePolicy', TextField::create("CookiePolicyButtonTitle")->setTitle(_t('CookiePolicy.BUTTONTITLE', "Button Title"))); $fields->addFieldToTab('Root.CookiePolicy', HtmlEditorField::create("CookiePolicyDescription")->setTitle(_t('CookiePolicy.DESCRIPTION', "Description"))); $fields->addFieldToTab('Root.CookiePolicy', DropdownField::create("CookiePolicyPosition")->setSource(singleton('SiteConfig')->dbObject('CookiePolicyPosition')->enumValues())->setTitle(_t('CookiePolicy.POSITION', "Position"))); }
public function updateCMSFields() { $fields = FieldList::create(TextField::create('Title'), TextareaField::create('Description'), $screenShot = UploadField::create('ScreenShot'), HtmlEditorField::create('Content')); $fields->addFieldToTab('Root.ScreenShots', $screenShot = UploadField::create('ScreenShot')); //Set allowed upload extensions $screenShot->getValidator()->setAllowedExtensions(array('png', 'gif', 'jpg', 'jpeg')); $screenShot->setFolderName('module-screenshots'); return $fields; }
public function updateCMSFields() { $fields = FieldList::create(TextField::create('Name'), $screenShot = UploadField::create('TestimonialPhoto'), HtmlEditorField::create('Content')); $fields->addFieldToTab('Root.TestimonialPhoto', $screenShot = UploadField::create('TestimonialPhoto')); //Set allowed upload extensions $screenShot->getValidator()->setAllowedExtensions(array('png', 'gif', 'jpg', 'jpeg')); $screenShot->setFolderName('Testimonial-Photos'); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldsToTab('Root.Main', array(TextField::create('Title'), HtmlEditorField::create('Summary')->setDescription('Short summary to show on hover')->setRows(5), HtmlEditorField::create('Content')->setDescription('Content of help article'), TreeDropdownField::create('ParentID', 'Parent', 'AdminHelp', 'ID', 'Title'))); if ($childrenGrid = $fields->fieldByName('Root.Children.Children')) { $childrenGrid->getConfig()->addComponent(GridFieldOrderableRows::create('Sort')); } return $fields; }
public function getCMSFields() { $this->beforeUpdateCMSFields(function (FieldList $fields) { $fields->addFieldsToTab('Root.Main', [TextField::create('Title', 'Question'), HtmlEditorField::create('Answer', 'Answer')->setRows(20)]); $fields->removeByName('SortOrder'); }); $fields = parent::getCMSFields(); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->removeFieldsFromTab('Root.Main', array('Content', 'Title', 'MenuTitle', 'URLSegment')); $fields->addFieldsToTab('Root.Main', array(HtmlEditorField::create('ContentLeft', 'Left Content'), HtmlEditorField::create('ContentLeft_cn', 'Left Content cn'), HtmlEditorField::create('ContentRight', 'Right Content'), HtmlEditorField::create('ContentRight_cn', 'Right Content cn'), $leftImagesField = UploadField::create('LeftImages', 'Left Images', $this->LeftImages()), $rightImagesField = UploadField::create('RightImages', 'Right Images', $this->RightImages())), 'Metadata'); $leftImagesField->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png'))->setAllowedMaxFileNumber(20)->setFolderName('LeftImages'); $rightImagesField->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png'))->setAllowedMaxFileNumber(20)->setFolderName('RightImages'); return $fields; }
public function updateCMSFields() { $fields = FieldList::create(TextField::create('FirstName'), TextField::create('LastName'), TextField::create('Position'), TextField::create('EmailAddress'), $screenShot = UploadField::create('StaffPhoto'), HtmlEditorField::create('Content')); $fields->addFieldToTab('Root.StaffPhoto', $screenShot = UploadField::create('StaffPhoto')); //Set allowed upload extensions $screenShot->getValidator()->setAllowedExtensions(array('png', 'gif', 'jpg', 'jpeg')); $screenShot->setFolderName('Staff-Photos'); return $fields; }
public function getCMSFields() { $this->beforeUpdateCMSFields(function (FieldList $fields) { $fields->addFieldsToTab('Root.Main', [TextField::create('Title', 'Author'), TextField::create('Company', 'Company'), DateField::create('Date', 'Date')->setConfig('showcalendar', true), UploadField::create('Image', 'Image'), HtmlEditorField::create('Testimonial', 'Testimonial')->setRows(20)]); $fields->removeByName('SortOrder'); $fields->removeByName('PageID'); }); $fields = parent::getCMSFields(); return $fields; }
public function updateCMSFields(FieldList $fields) { $fields->addFieldToTab("Root.Grid", TextareaField::create("GridLayout")); if ($this->owner->GridLayout) { $fields->addFieldToTab("Root.Main", GridSelectionField::create("GridPos", "Content Position", $this->owner->GridLayout), "Content"); $fields->addFieldToTab("Root.Main", HtmlEditorField::create("GridContent", "Content")->setAttribute("data-gscdelimiter", GSCRenderer::$defaultdelimiter), "Content"); $fields->addFieldToTab("Root.Main", GSCHiddenContentField::create("Content"), "GridContent"); Requirements::javascript("gridstructuredcontent/javascript/gridedit.js"); } }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldToTab('Root.Main', $summarySize); $fields->addFieldToTab('Root.Main', $BlogImage = new UploadField('SummaryImage')); $folderName = 'BlogImages/' . $this->Name . '/'; $BlogImage->setFolderName($folderName); $BlogImage->getValidator()->setAllowedExtensions(array('jpg', 'jpeg', 'png', 'gif')); $fields->addFieldToTab('Root.Main', HtmlEditorField::create('Content')); return $fields; }
function getCMSFields() { $fields = parent::getCMSFields(); $fields->removeFieldsFromTab('Root.Main', array('Name', 'InfoWindow', 'lat', 'lng')); $fields->addFieldToTab('Root.Main', new TextField('Name', 'Name', $this->Name), 'Address1'); $fields->addFieldToTab('Root.Main', $infoWindow = HtmlEditorField::create('InfoWindow')); $infoWindow->setRows(8); // limit the height of the editor $fields->addFieldToTab('Root.Main', new TextField('lat', 'Latitude', $this->lat), 'InfoWindow'); $fields->addFieldToTab('Root.Main', new TextField('lng', 'Longitude', $this->lng), 'InfoWindow'); return $fields; }
function getCMSFields() { $fields = FieldList::create(TabSet::create(Root)); $fields->addFieldToTab("Root.Main", TextField::create('Name', 'Author Name')); $fields->addFieldToTab("Root.Main", TextareaField::create('ShortBio', 'Author Short Bio')); $fields->addFieldToTab("Root.Main", HtmlEditorField::create('FullBio', 'Full Author Bio')); $fields->addFieldToTab("Root.Main", TextField::create('Email', 'Author Email')); $fields->addFieldToTab("Root.Main", CheckboxField::create('IsPrivateEmail', 'Keep Email Private?')); $fields->addFieldToTab("Root.Main", TextField::create('Website', 'Author Website')); $fields->addFieldToTab("Root.Main", UploadField::create('Photo', 'Author Photo')); return $fields; }
/** * @return FieldList */ public function getCMSFields() { /** ========================================= * @var FieldList $fields * @var TextField $title * @var OptionsetField $type * @var HtmlEditorField $content * @var CheckboxField $RemovePadding * @var CheckboxField $externalLink * @var UploadField $image * @var FieldGroup $linkSettings * @var GridFieldConfig_RelationEditor $config ===========================================*/ $fields = FieldList::create(TabSet::create('Root')); $fields->addfieldToTab('Root.Main', $title = TextField::create('Title')); $title->setRightTitle('Title used in the cms as a visual cue for this piece of content.'); $fields->addfieldToTab('Root.Main', $type = OptionsetField::create('Type', 'Type', $this->dbObject('Type')->enumValues())); $type->setRightTitle('Determines what fields are displayed in the CMS, and what content is displayed in the front-end.'); $contentField = $content = HtmlEditorField::create('Content'); $content->setRows(15); $fields->addfieldToTab('Root.Main', CheckboxField::create('RemovePadding', 'Remove padding from image')); $fields->addfieldToTab('Root.Main', CheckboxField::create('CoverImage', 'Make image a cover image')); $fields->addfieldToTab('Root.Main', TextField::create('MaxWidth', 'Max width of text fields')->setAttribute('placeholder', 'e.g. 768')); if ($this->Type == 'Content') { $fields->addfieldToTab('Root.Main', $contentField); } if ($this->Type == 'Image') { $fields->addfieldToTab('Root.Main', $image = UploadField::create('Image')); $image->setAllowedExtensions(array('jpeg', 'jpg', 'gif', 'png')); $image->setFolderName('Uploads/site-builder/items'); $fields->addfieldToTab('Root.Main', HeaderField::create('', 'Link (optional)', 4)); $fields->addfieldToTab('Root.Main', TreeDropdownField::create('InternalLinkID', 'Internal Link', 'SiteTree')); $fields->addfieldToTab('Root.Main', $externalLink = TextField::create('ExternalLink')); $externalLink->setAttribute('placeholder', 'http://'); $externalLink->setRightTitle('Setting an external link will override the internal link.'); $fields->addfieldToTab('Root.Main', $linkSettings = FieldGroup::create(array(CheckboxField::create('OpenLinkInNewTab', 'Open link in a new tab?')))); $linkSettings->setTitle('Settings'); $fields->addfieldToTab('Root.Main', HeaderField::create('', 'Content (optional)', 4)); $fields->addfieldToTab('Root.Main', $contentField); } if ($this->Type == 'Video') { $fields->addFieldToTab('Root.Main', TextareaField::create('YoutubeLink')); $fields->addFieldToTab('Root.Main', TextareaField::create('VimeoLink')); } if ($this->Type == 'Slider') { $config = GridFieldConfig_RelationEditor::create(10); $config->addComponent(GridFieldOrderableRows::create('SortOrder'))->addComponent(new GridFieldDeleteAction()); $gridField = GridField::create('SliderItems', 'Items', $this->SliderItems(), $config); $fields->addFieldToTab('Root.Main', $gridField); } return $fields; }
public function getCMSFields() { $fields = FieldList::create(); $fields->push(HeaderField::create('Note', _t('GoogleDirectionsMap.HEADER', 'Create a Map...'), 2)); $fields->push(LiteralField::create('Note', _t('GoogleDirectionsMap.NOTE', '<strong>Note:</strong> lattitude and longitude take presedence over address'))); $fields->push(TextField::create('LinkID', _t('GoogleDirectionsMap.LINKID', 'Title'))); $fields->push(TextField::create('LatLng', _t('GoogleDirectionsMap.LATLNG', 'LatLng'))); $fields->push(TextField::create('Address', _t('GoogleDirectionsMap.ADDRESS', 'Address'))); $fields->push(CheckboxField::create('ShowOnStartup', _t('GoogleDirectionsMap.SHOWONSTARTUP', 'Display on startup'))); $fields->push(HtmlEditorField::create('InfoText', _t('GoogleDirections.INFOTEXT', 'Info text'))->setRows(16)); $fields->push(HiddenField::create('PageID', 'PageID')); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldToTab('Root.Main', new TextField('Title', 'Title'), ''); $fields->addFieldToTab('Root.Main', new CheckboxField('HideTitle', 'Hide Title'), ''); $fields->addFieldToTab('Root.Main', new UploadField('Picture', 'Picture'), ''); $fields->addFieldToTab('Root.Main', new DropdownField('Align', 'Align Image', singleton('ExtraContentBlock')->dbObject('Align')->enumValues()), ''); $fields->addFieldToTab("Root.Main", HtmlEditorField::create("Content", "Content")->setRows(22)); // tidy up the CMS by not showing these fields $fields->removeFieldFromTab("Root.Main", "PageID"); $fields->removeFieldFromTab("Root.Main", "SortOrder"); $fields->removeFieldFromTab("Root.Main", "Page"); return $fields; }
function getCMSFields() { $f = parent::getCMSFields(); $f->removeByName(array('SortOrder', 'Image')); $f->removeByName('SortOrder'); $f->addFieldsToTab('Root.Main', HtmlEditorField::create("Description")->setRows(15)); $f->addFieldsToTab('Root.Image', $HeroImage = new UploadField('Image', 'Please upload a Hero image <span>(max. 1 files)</span>')); $HeroImage->setAllowedFileCategories('image'); $HeroImage->setAllowedMaxFileNumber(1); $HeroImage->getValidator()->setAllowedExtensions(array('jpg', 'jpeg', 'png', 'gif')); $HeroImage->setConfig('allowedMaxFileNumber', 1); $HeroImage->setFolderName('Uploads/Distributors/' . $this->URLSegment); return $f; }
public function getCMSFields() { $f = parent::getCMSFields(); $gridFieldConfig = GridFieldConfig_RecordEditor::create(); $gridField = new GridField('Distributors', 'Testimonials', $this->Distributors(), $gridFieldConfig); $f->addFieldsToTab('Root.Distributors', array(CheckboxField::create('AllowAddingDistributors'), TextField::create('AddButtonText'), $gridField)); if ($this->AllowAddingDistributors) { $f->addFieldsToTab('Root.Main', HtmlEditorField::create("AddContent", "Distributors add content")->setRows(15)); } $PageImage = UploadField::create("MapIcon", "Please upload your map Icon image"); $PageImage->setAllowedFileCategories('image'); $PageImage->setAllowedMaxFileNumber(1); $PageImage->setFolderName('Uploads/MapIcon'); $f->addFieldsToTab("Root.Images", $PageImage); return $f; }