|
Mambo portal needs tweaking to get good listings on search engines, since it does not set the <title> tag for each of your content pages. The <title> tag appears in the window bar of your web browser and is thus the headline piece of text seen by your users and by search engines!
The <title> tag on pages contains the keywords that will be judged most significant by search engines.
We refer you to this discussion on how to fix Mambo, which by default will only use your overall site name in the <title> tags.
This fix to Mambo is not complex and is likely to make a lot of positive difference to your search engine listings.
The discussion above did not come to a full solution at time of writing. So we refer you to our search engine title mod, which is an amalgam of solutions.
One important fact to note in Mambo, is that title_alias is meant to be a short version of the title for SEF, Search Engine Friendly URLs. As such it is not meant to be abused for using in title bars! Some versions of this hack have used title_data wrongly for this purpose.
Firstly, you need the file titledata.php in your mambo/includes directory.
<?php // titledata.php /** // Based on metadata.php * @package Mambo Open Source * @Copyright (C) 2000 - 2003 Miro International Pty Ltd * @ All rights reserved * @ Mambo Open Source is Free Software * @ Released under GNU/GPL License : http://www.gnu.org/copyleft/gpl.html **/
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
function showTitle( &$database, $option ) { $ptitle = mosGetParam( $_REQUEST, 'title', 0);
$task = mosGetParam( $_REQUEST, 'task', 0); $pageTitle = '';
if ($option == 'content') { $id = mosGetParam( $_REQUEST, 'id', 0 ); if ($id) { switch ($task) { case "view": $row = new mosContent( $database ); $row->load( $id ); if ($ptitle != "") { } else { $ptitle = $row->title; } $pageTitle = $ptitle; break; case "category": case "blogcategory": case "archivecategory": $row = new mosCategory( $database ); $row->load( $id ); if ($ptitle != "") { } else if ($row->name != "") { $ptitle = $row->name; } else { $ptitle = $row->title; }
$pageTitle = $ptitle; break; case "section": case "blogsection": case "archivesection": $row = new mosSection( $database ); $row->load( $id ); if ($ptitle != "") { } else if ($row->name != "") { $ptitle = $row->name; } else { $ptitle = $row->title; } $pageTitle = $ptitle; break; default: break; } } }else { $id = mosGetParam( $_REQUEST, 'Itemid', 0 ); if ($id) { $row = new mosMenu( $database ); $row->load( $id ); $pageTitle = $row->name; } }
echo $pageTitle; } showTitle( $database, $option ); ?>
secondly you need to examime the index.php file in your template directory.
There will be:
<title><?php echo $mosConfig_sitename; ?></title>
change this to:
<title><?php echo $mosConfig_sitename; ?> <?php include ("includes/titledata.php"); ?></title>
and that's it. This version of the title fix, uses the title_alias if it is defined, so that you can create long effective titles. It also allows title to be passed in the url, which can be handy for linking to components where Mambo will otherwise be confused as to where the title should come from.
|