1
私は以下のコードを使ってメタタイトルを作成しましたが、ほとんどのウェブサイトで動作しますが、特定のウェブサイトはメタタイトルを保存しません。 1つは保存されていません。カスタムシルバーストライプメタフィールドが保存されない
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;
}
}
あなたは/ dev/buildを呼び出しましたか?flush = 1?おそらくフィールドはあなたのdbにありません –
@csyあなたは正しいです、dev /ビルドとフラッシュが必要です。 –