Joomla 1.5 Title Tags

Joomla 1.5 Title Tags
Since it took me the better part of an afternoon to figure this out, I’m going to immortalize it here for future Googlers. You see, there’s no nice way in Joomla 1.5 to customize the head title tags of each page. (According to this site it was meant to be included – they even have a screen shot! – but somehow the Joomla Powers That Be decided to kill it.) There are numerous third-party extensions that can allow you to set custom titles, but you have to specify the title on every single page. All I wanted was to have the name of the actual website appear before the page title without hacking the Joomla core. (Joomla generates the page title on the fly. Yes, you can modify the script that generates it, but on this particular project we’re trying to leave the core untouched so future upgrades don’t break it.) So finally, after several hours, I chanced upon this site which talks about modifying the header to remove unnecessary javascript files. “A-HA!” I thought. “This is the answer!” So here you go:

<head>
<?php
$headerstuff = $this->getHeadData();
$headerstuff['title'] = "My Site Name - " .
                        $headerstuff['title'];
$this->setHeadData($headerstuff);
?>
<jdoc:include type="head" />

2 Comments

Add yours →

  1. english do you speak english
    is that SSK or K2TOG?
    I don’t understand

  2. Heehee. It’s my other life.

Comments are closed.