Add options to customize the browser title format

This commit is contained in:
Kijin Sung 2016-05-09 22:39:19 +09:00
parent f25e685209
commit 9bdc30b325
11 changed files with 79 additions and 18 deletions

View file

@ -317,7 +317,16 @@ class boardView extends board
else
{
// add the document title to the browser
Context::addBrowserTitle($oDocument->getTitleText());
Context::setCanonicalURL($oDocument->getPermanentUrl());
$seo_title = config('seo.document_title') ?: '$SITE_TITLE - $DOCUMENT_TITLE';
getController('module')->replaceDefinedLangCode($seo_title);
Context::setBrowserTitle($seo_title, array(
'site_title' => Context::getSiteTitle(),
'site_subtitle' => Context::getSiteSubtitle(),
'subpage_title' => $module_info->browser_title,
'document_title' => $oDocument->getTitleText(),
'page' => Context::get('page') ?: 1,
));
// update the document view count (if the document is not secret)
if(!$oDocument->isSecret() || $oDocument->isGranted())
@ -338,12 +347,6 @@ class boardView extends board
// setup the document oject on context
$oDocument->add('module_srl', $this->module_srl);
Context::set('oDocument', $oDocument);
// set canonical URL
if ($oDocument->document_srl)
{
Context::setCanonicalURL($oDocument->getPermanentUrl());
}
/**
* add javascript filters