Navigation Menu

Skip to content

Commit

Permalink
Improve Meta Description for Sections / Categories #4267 (#4268)
Browse files Browse the repository at this point in the history
  • Loading branch information
810 committed Aug 9, 2016
1 parent 8502e69 commit 3a18d10
Showing 1 changed file with 8 additions and 0 deletions.
Expand Up @@ -155,6 +155,7 @@ protected function prepareDocument()

$parentText = $this->category->getParent()->displayField('name');
$categoryText = $this->category->displayField('name');
$categorydesc = $this->category->description;

$app = JFactory::getApplication();
$menu_item = $app->getMenu()->getActive();
Expand Down Expand Up @@ -182,11 +183,18 @@ protected function prepareDocument()
if (!empty($params_description))
{
$description = $params->get('menu-meta_description');
$description = substr($description, 0, 140) . '... ' . $pagesText;
$this->setDescription($description);
}
elseif (!empty($categorydesc))
{
$categorydesc = substr($categorydesc, 0, 140) . '... ' . $pagesText;
$this->setDescription($categorydesc);
}
else
{
$description = "{$parentText} - {$categoryText}{$pagesText} - {$this->config->board_title}";
$description = substr($description, 0, 140) . '...';
$this->setDescription($description);
}
}
Expand Down

0 comments on commit 3a18d10

Please sign in to comment.