Web Design Lancaster 01524 63492

Joomla 1.5 Set Meta Description On Menu ID

In Joomla 1.5 you have no control over meta description and meta keywords for most components.

Fix Joomla Problem - Replace Global Metas

Here is a short list of some of the components in question:

  • Contacts
  • Category Blogs
  • Section Blogs
  • Web Links
  • Home Page
  • DT Register
  • J Events
  • Chrono Forms
  • VirtueMart

Set Custom Meta Description Joomla 1.5

On the whole it is just the first/front page of these components that you have no control of the metas.

Here is a work around that enebles you to set the metas you want on any page that has a menu link.

This will involve editing you templates index.php file. You should do this via ftp (file transfer protocol) or similar server file editing software. You might be able to do this via your Joomla administrator area using the template manager function.

Replace Global Metas Joomla 1.5

Some Joomla 1.5 templates are built on a framework so the main index.php file within your active template folder might not be the file you need to edit, you will need to track down the file that has this tag in it '<jdoc:include type="head" />'. If you are struggling to find the file, download it to your computer and serch the folder for the tag in question.

When you have found the file with the include head tag, past this code into the file directly below the '<jdoc:include type="head" />' tag.

<?php
$currentMenuId = JSite::getMenu()->getActive()->id ;
if($currentMenuId == '139') // 139 is the ID number of the menu pointing to the component
{
$this->setMetaData( 'description', 'my description' );
$this->setMetaData( 'keywords', 'my keyword' );
}
else
{
// do nothing
}
?>

How To Override Joomla 1.5 Global Metas - Description / Keywords

Override Global Meta Description Joomla 1.5This line 'if($currentMenuId == '139')' refers to the menu item identifier (itemid), in the admin area of your website find the menu item that you want to add custom metas to and replace '139' with the number on the far right hand column.

In the two lines that begin '$this->setMetaData' replace the 'my description' with your own meta description for that page and obviously the same with meta keywords.

You can implement this as many times as you like, it will not have any nock on effects.

Google does not use keywords in its rankings but other search engines do, please make sure to have keywords set on every page!

Web Design Lancaster - Fix My Joomla Problem

If you have difficulty getting this to work or you do not have the time or inclination to do it yourself, Web Design Lancaster can implement this for you. To save money list the menu item identifiers (itemid) with the corresponding descriptions and keywords, ftp details will also be required.

Contact Web Design Lancaster for further details.

Contact Expert Joomla Web Designers

Call us today on 0800 756 6482 / 01524 63492, or use our contact form, for further information and to arrange a discussion about your web design - Joomla requirements.