"backpack/logmanager": "^2.3",
"backpack/menucrud": "^1.0",
"backpack/newscrud": "^2.1",
- "backpack/pagemanager": "^1.1",
"backpack/permissionmanager": "^4.0",
"backpack/settings": "^2.1",
"backpack/langfilemanager": "^1.0",
class CMSPage extends CubistMagicModel
{
+ protected static $_templates = [];
+
protected $table = 'cms_pages';
protected $_options = ['name' => 'page',
'label' => 'Template',
'options' => $this->getTemplates(),
'column' => true,
- 'tab'=>'General',
+ 'tab' => 'General',
]);
$this->addField(['name' => 'name',
'type' => 'Text',
'column' => true,
'hint' => trans('for admin use'),
- 'tab'=>'General',
+ 'tab' => 'General',
]);
$this->addField(['name' => 'title',
'type' => 'Slug',
'label' => 'Slug (URL)'
]);
+
+ $this->_common();
+ }
+
+ protected function _common()
+ {
+ $this->addFakeField([
+ 'name' => 'status',
+ 'type' => 'SelectFromArray',
+ 'default' => '0',
+ 'label' => __('Status'),
+ 'options' => ['0' => __('Offline'), '1' => __('Published')],
+ 'tab' => 'Général',
+ ]);
+ $this->_seo();
+ }
+
+ protected function _seo()
+ {
+ $this->addFakeField([
+ 'name' => 'meta_title',
+ 'label' => trans('backpack::pagemanager.meta_title'),
+ 'type' => 'Text',
+ 'hint' => trans('If empty, page title is used.') . ' ' . __('Recommended length: 60 chars'),
+ 'tab' => 'Meta // SEO',
+ 'store_in'=>'seo',
+ ]);
+ $this->addFakeField([
+ 'name' => 'meta_description',
+ 'label' => trans('backpack::pagemanager.meta_description'),
+ 'type' => 'Textarea',
+ 'hint' => __('Recommended length: 160 chars'),
+ 'tab' => 'Meta // SEO',
+ 'store_in'=>'seo',
+ ]);
+ $this->addFakeField([
+ 'name' => 'robots',
+ 'label' => __('Allow page index by search engines'),
+ 'type' => 'Checkbox',
+ 'default' => true,
+ 'tab' => 'Meta // SEO',
+ 'store_in'=>'seo',
+ ]);
}
public function getTemplates($template_name = false)