1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-13 01:54:12 +02:00

Closes #4783 Added Page Meta-Title field and synced with Page title.

Issue #6 global LAN_META_DESCRIPTION and LAN_META_TITLE added and replacements made throughout.
This commit is contained in:
Cameron
2022-06-08 18:29:37 -07:00
parent 782c51ff18
commit 52cf8f5bfa
13 changed files with 128 additions and 62 deletions

View File

@@ -599,8 +599,10 @@ class page_admin_ui extends e_admin_ui
'page_comment_flag' => array('title'=> LAN_COMMENTS, 'tab' => 1, 'type' => 'boolean', 'data'=>'int', 'width' => '5%', 'thclass' => 'center', 'class' => 'center' ),
'page_password' => array('title'=> LAN_PASSWORD, 'tab' => 1, 'type' => 'text', 'data'=>'str', 'width' => 'auto', 'writeParms'=>array('password'=>1, 'nomask'=>1, 'size' => 40, 'class' => 'tbox e-password', 'generate' => 1, 'strength' => 1, 'required'=>0)),
'page_sef' => array('title'=> LAN_SEFURL, 'tab' => 1, 'type' => 'text', 'batch'=>true, 'data'=>'str', 'inline'=>true, 'width' => 'auto', 'writeParms'=>'size=xxlarge&sef=page_title'),
'page_metatitle' => array('title'=> LAN_META_TITLE, 'tab' => 1, 'type' => 'text', 'data'=>'str', 'width' => 'auto', 'inline'=>true, 'writeParms'=>['size'=>'xxlarge']),
'page_metadscr' => array('title'=> LAN_META_DESCRIPTION, 'tab' => 1, 'type' => 'textarea', 'data'=>'str', 'help'=>CUSLAN_82, 'width' => 'auto', 'writeParms'=>array('size'=>'xxlarge', 'rows'=>2, 'maxlength'=>155)),
'page_metakeys' => array('title'=> LAN_KEYWORDS, 'tab' => 1, 'type' => 'tags', 'data'=>'str', 'width' => 'auto', 'inline'=>true),
'page_metadscr' => array('title'=> CUSLAN_11, 'tab' => 1, 'type' => 'textarea', 'data'=>'str', 'help'=>CUSLAN_82, 'width' => 'auto', 'writeParms'=>array('size'=>'xxlarge', 'rows'=>2, 'maxlength'=>155)),
'page_metaimage' => array('title'=> CUSLAN_81, 'nolist'=>false, 'tab' => 1, 'type' => 'image', 'help'=> CUSLAN_82, 'width' => '110px', 'thclass' => 'center', 'class' => "center", 'nosort' => false, 'readParms'=>'thumb=60&thumb_urlraw=0&thumb_aw=60','writeParms'=>'media=page^&video=1', 'readonly'=>false),
'page_metarobots' => array('title' => LAN_ROBOTS, 'tab'=>1, 'type' => 'dropdown', 'data'=>'safestr', 'batch'=>true, 'inline'=>true, 'readParms'=>array('type'=>'checkboxes'), 'width' => 'auto', 'thclass' => 'left', 'class' => 'left', 'nosort' => false, 'filter'=>true),
@@ -928,7 +930,7 @@ class page_admin_ui extends e_admin_ui
{
parent::CreateObserver();
$this->initCustomFields(0);
$this->initSEOFields();
}
@@ -944,9 +946,25 @@ class page_admin_ui extends e_admin_ui
$this->initCustomFields($chap);
$this->loadCustomFieldsData();
$this->initSEOFields();
}
private function initSEOFields()
{
eHelper::syncSEOTitle('page-title', 'page-metatitle');
$seoTitleLimit = (int) e107::pref('core', 'seo_title_limit', 100);
$seoDescriptionLimit = (int) e107::pref('core', 'seo_description_limit', 180);
$this->fields['page_metatitle']['writeParms']['counter'] = $seoTitleLimit;
$this->fields['page_metatitle']['help'] = e107::getParser()->lanVars(LAN_SEARCH_ENGINES_X_LIMIT, $seoTitleLimit);
$this->fields['page_metadscr']['writeParms']['counter'] = $seoDescriptionLimit;
$this->fields['page_metadscr']['help'] = e107::getParser()->lanVars(LAN_SEARCH_ENGINES_X_LIMIT, $seoDescriptionLimit);
}
/**
* Filter/Process Posted page_field data;
* @param $new_data