Skip to content

Commit

Permalink
Restore the change to category view
Browse files Browse the repository at this point in the history
  • Loading branch information
joomdonation committed Dec 30, 2017
1 parent 3210416 commit 7dba3bd
Showing 1 changed file with 26 additions and 7 deletions.
33 changes: 26 additions & 7 deletions components/com_content/views/category/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,32 +212,51 @@ public function display($tpl = null)
$title = $this->category->title;
}

$this->params->set('page_title', $title);
$this->document->setTitle($title);

if ($this->category->metadesc)
{
$this->params->set('menu-meta_description', $this->category->metadesc);
$this->document->setDescription($this->category->metadesc);
}
elseif ($this->params->get('menu-meta_description'))
{
$this->document->setDescription($this->params->get('menu-meta_description'));
}

if ($this->category->metakey)
{
$this->params->set('keywords', $this->category->metakey);
$this->document->setMetadata('keywords', $this->category->metakey);
}
elseif ($this->params->get('menu-meta_keywords'))
{
$this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
}

if ($this->params->get('robots'))
{
$this->document->setMetadata('robots', $this->params->get('robots'));
}

if (!is_object($this->category->metadata))
{
$this->category->metadata = new Registry($this->category->metadata);
}

if (($app->get('MetaAuthor') == '1') && $this->category->get('author', ''))
{
$this->document->setMetaData('author', $this->category->get('author', ''));
}

$mdata = $this->category->metadata->toArray();

if ($app->get('MetaAuthor') == '1' && $this->category->get('author', ''))
foreach ($mdata as $k => $v)
{
$mdata['author'] = $this->category->get('author', '');
if ($v)
{
$this->document->setMetadata($k, $v);
}
}

$this->params->set('metadata', $mdata);

return parent::display($tpl);
}

Expand Down

0 comments on commit 7dba3bd

Please sign in to comment.