Menü schliessen
Created: April 25th 2012
Last updated: May 1st 2020
Categories: Joomla
Author: Marcus Fleuti

Joomla :: Set individual page title based on variable document information

Tags:  Joomla
Donation Section: Background
Monero Badge: QR-Code
Monero Badge: Logo Icon Donate with Monero Badge: Logo Text
82uymVXLkvVbB4c4JpTd1tYm1yj1cKPKR2wqmw3XF8YXKTmY7JrTriP4pVwp2EJYBnCFdXhLq4zfFA6ic7VAWCFX5wfQbCC

Use the following code to display a variable page (document) title in your Joomla project:

Add the following code to your templates' index.php file BEFORE the <jdoc:include type="head" /> includes:

$mydoc = JFactory::getDocument();
$title = $mydoc->getTitle();
$app = JFactory::getApplication();
$this->setTitle( $app->getCfg( 'sitename' ) . ' - ' . $title );