public function updateCMSFields(FieldList $fields)
    {
        // Remove all Meta fields
        $fields->removeByName('Metadata');
        // Add summary fields
        $fields->addFieldToTab('Root.Main', TextAreaField::create('MetaDescription', _t('JonoM\ShareCare\ShareCareSummary.SummaryTitle','Content summary'))
            ->setDescription(_t('JonoM\ShareCare\ShareCareSummary.SummaryDescription','Summarise the content of this page. This will be used for search engine results and social media so make it enticing.'))
            ->setAttribute('placeholder', $this->owner->getDefaultOGDescription())
            ->setRows(2), 'Content');
        $imgFieldDescription = _t('JonoM\ShareCare\ShareCareSummary.ImageDescription','Choose an image to represent this page in listings and on social media.');
        if (!$this->owner->MetaImageID && $this->owner->isPublished()) {
            $imgFieldDescription .= " <i style=\"color:#ec720f\">" . _t('JonoM\ShareCare\ShareCareSummary.ImageDescriptionNotEmpty','For best results, please don\'t leave this empty.') . "</i>";
        }
        $fields->addFieldToTab('Root.Main', UploadField::create('MetaImage', _t('JonoM\ShareCare\ShareCareSummary.ImageTitle','Summary image'))
            ->setAllowedFileCategories('image')
            ->setAllowedMaxFileNumber(1)
            ->setDescription($imgFieldDescription), 'Content');
    }
public function updateCMSFields(FieldList $fields)
    {
        // Remove all Meta fields
        $fields->removeByName('Metadata');
        // Add summary fields
        $fields->addFieldToTab('Root.Main', TextAreaField::create('MetaDescription', _t('JonoM\ShareCare\ShareCareSummary.SummaryTitle','Content summary'))
            ->setDescription(_t('JonoM\ShareCare\ShareCareSummary.SummaryDescription','Summarise the content of this page. This will be used for search engine results and social media so make it enticing.'))
            ->setAttribute('placeholder', $this->owner->getDefaultOGDescription())
            ->setRows(2), 'Content');
        $imgFieldDescription = _t('JonoM\ShareCare\ShareCareSummary.ImageDescription','Choose an image to represent this page in listings and on social media.');
        if (!$this->owner->MetaImageID && $this->owner->isPublished()) {
            $imgFieldDescription .= " <i style=\"color:#ec720f\">" . _t('JonoM\ShareCare\ShareCareSummary.ImageDescriptionNotEmpty','For best results, please don\'t leave this empty.') . "</i>";
        }
        $fields->addFieldToTab('Root.Main', UploadField::create('MetaImage', _t('JonoM\ShareCare\ShareCareSummary.ImageTitle','Summary image'))
            ->setAllowedFileCategories('image')
            ->setAllowedMaxFileNumber(1)
            ->setDescription($imgFieldDescription), 'Content');
    }
public function updateCMSFields ( FieldList $ fields ) { // Remove all Meta fields $ fields -> removeByName ( 'Metadata' ) ; // Add summary fields $ fields -> addFieldToTab ( 'Root.Main' , TextAreaField :: create ( 'MetaDescription' , _t ( 'JonoM\ShareCare\ShareCareSummary.SummaryTitle' , 'Content summary' ) ) -> setDescription ( _t ( 'JonoM\ShareCare\ShareCareSummary.SummaryDescription' , 'Summarise the content of this page. This will be used for search engine results and social media so make it enticing.' ) ) -> setAttribute ( 'placeholder' , $ this -> owner -> getDefaultOGDescription ( ) ) -> setRows ( 2 ) , 'Content' ) ; $ imgFieldDescription = _t ( 'JonoM\ShareCare\ShareCareSummary.ImageDescription' , 'Choose an image to represent this page in listings and on social media.' ) ; if ( ! $ this -> owner -> MetaImageID && $ this -> owner -> isPublished ( ) ) { $ imgFieldDescription .= " <i style=\"color:#ec720f\">" . _t ( 'JonoM\ShareCare\ShareCareSummary.ImageDescriptionNotEmpty' , 'For best results, please don\'t leave this empty.' ) . "</i>" ; } $ fields -> addFieldToTab ( 'Root.Main' , UploadField :: create ( 'MetaImage' , _t ( 'JonoM\ShareCare\ShareCareSummary.ImageTitle' , 'Summary image' ) ) -> setAllowedFileCategories ( 'image' ) -> setAllowedMaxFileNumber ( 1 ) -> setDescription ( $ imgFieldDescription ) , 'Content' ) ; }
Add and re-arrange CMS fields for streamlined summary editing.
Add and re - arrange CMS fields for streamlined summary editing .