When you are looking a category or section, why no change the document title by the sections/category name?
Change title by category name
-
JoniJnm
- Phoca Newbie

- Posts: 1
- Joined: 28 Jan 2012, 16:30
- Location: Madrid
- Contact:
Change title by category name
Hi,
When you are looking a category or section, why no change the document title by the sections/category name?
When you are looking a category or section, why no change the document title by the sections/category name?
- Jan
- Phoca Hero

- Posts: 49144
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Change title by category name
Hi, if the page title is empty (parameters of menu link), then the category name is displayed.
Jan
Code: Select all
$title = $this->params->get('page_title', '');
if (empty($title) || (isset($title) && $title == '')) {
$title = $this->item->title; // category title
}
if (empty($title) || (isset($title) && $title == '')) {
$title = htmlspecialchars_decode($app->getCfg('sitename'));
} else if ($app->getCfg('sitename_pagetitles', 0)) {
$title = JText::sprintf('JPAGETITLE', htmlspecialchars_decode($app->getCfg('sitename')), $title);
}
$this->document->setTitle($title);If you find Phoca extensions useful, please support the project