Alexander Conroy

Joomla! Hack – Save Title Alias with Capital / Uppercase letters

How to stop Joomla from Reformatting your Title Alias to Lowercase

I found this core hack a while ago but couldn’t find it again. I searched and searched until eventually I went digging through Joomla files to find out where it was.

If you are tired of having Joomla overwrite your Title Alias, or Article Alias, then this hack is for you. This is very useful when transferring over sites from different systems which used an alias field as the page title, and was case sensitive.

The file you need to edit is:

The line of code you are looking for is

$str = trim(strtolower($str));
return $str;

change this to

$str = trim($str);
return $str;

Do not remove the block of code all together as doing this will cause Joomla to replace your alias’ with Time Stamps.

The following is the full function edited

function stringURLSafe($string)
//remove any ‘-‘ from the string they will be used as concatonater
$str = str_replace(‘-‘, ‘ ‘, $string);

$lang =& JFactory::getLanguage();
$str = $lang->transliterate($str);

// remove any duplicate whitespace, and ensure all characters are alphanumeric
$str = preg_replace(array(‘/\s+/’,’/[^A-Za-z0-9\-]/’), array(‘-‘,”), $str);

// lowercase and trim
$str = trim($str);
return $str;