Change title by category name

Phoca Download - download manager
JoniJnm
Phoca Newbie
Phoca Newbie
Posts: 1
Joined: 28 Jan 2012, 16:30
Location: Madrid
Contact:

Change title by category name

Post by JoniJnm »

Hi,

When you are looking a category or section, why no change the document title by the sections/category name? :-)
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48610
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Change title by category name

Post by Jan »

Hi, if the page title is empty (parameters of menu link), then the category name is displayed.

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);
Jan
If you find Phoca extensions useful, please support the project
Post Reply