How to Display Your Site's Name in Your Template

Joomla! 1.5 doesn't automatically add your site's name in the page title that appears in your browser (upper left next to the browser icon).

For example, if you have an About Us page, it might show this "out-of-the-box":

About Us

 

If you site name is added, it might show:

About Us - Your Organization Here

 

To add your site name, you can include the following in your Joomla! index.php template file:

<?php
 
$mydoc =& JFactory::getDocument();
$mytitle = $mydoc->getTitle();
 
$conf =& JFactory::getConfig();
$sitename = $conf->getValue('config.sitename');
 
$mydoc->setTitle($mytitle.' - '.$sitename);
 
?>


Adapted from http://www.howtojoomla.net/2008060586/how-tos/templates/how-to-display-y...

 

 

 

Your Inbox, Our Secrets

Email:
Small Nonprofit Web Tips
Organic SEO Tips
Secret CiviCRM User Tips