1
votes

I created a Meta Title using the code below but it works for majority of my websites but one particular website will not save the the Meta Title so when I edit it shows my previously entered title, same code for all websites but one is not saving?

class Page extends SiteTree {

    private static $db = array(
      'MetaTitle' => 'Varchar(255)'
    );

    private static $has_one = array(
    );

    public function getCMSFields() {
        $fields = parent::getCMSFields();

        $fields->addFieldToTab('Root.Main', TextField::create('MetaTitle')
                ->setRightTitle('Shown at the top of the browser window and used as the "linked text" by search engines.')
                ->addExtraClass('help')
            , 'MetaDescription');

        return $fields;
    }

}
1
did you call /dev/build?flush=1 ? perhaps the field is not in your db - csy_dot_io
@csy you are correct, dev/buils and flush is needed. - Learner One

1 Answers

0
votes

If you do not /dev/build after adding a new $db property, changes will not save properly.