We seem to have gotten things working as they should be by installing JoomSEF 1.5.1, un-installing the mambot that comes with it, uploading the 1.5.0 mambot and then replacing /mambots/system/joomsef_metabot.php with the following code:
<?php
/**
* SEF module for Joomla!
*
* @author $Author: michal $
* @copyright ARTIO s.r.o., http://www.artio.cz
* @package JoomSEF
* @version $Name$, ($Revision: 4994 $, $Date: 2005-11-03 20:50:05 +0100 (??t, 03 XI 2005) $)
* @license Released under the terms of the GNU General Public License
*
* File edited by Bathcomms (http://www.bathcomms.co.uk) on 16 July 2007
*/
// Security check to ensure this file is being included by a parent file.
if (!defined('_VALID_MOS')) die('Direct Access to this location is not allowed.');
$_MAMBOTS->registerFunction('onAfterStart', 'generateSEFMeta');
function generateSEFMeta()
{
global $mainframe, $database, $mosConfig_MetaKeys, $mosConfig_MetaDesc;
// Get the mambot's parameters
$query = \"SELECT id FROM #__mambots WHERE element = 'joomsef_metabot' AND folder = 'system'\";
$database->setQuery($query);
$id = $database->loadResult();
$mambot = new mosMambot($database);
$mambot->load($id);
$params = new mosParameters($mambot->params);
$rewriteKeywords = $params->get('rewrite_keywords');
$rewriteDescription = $params->get('rewrite_description'); /* NEW LINE BY BATHCOMMS */
$preferTitle = $params->get('prefer_joomsef_title');
// Add metatags if there are any
if (isset($GLOBALS['sefMetaTags'])) {
$tags = $GLOBALS['sefMetaTags'];
// Page title
if (isset($tags['title'])) {
$mainframe->setPageTitle($tags['title']);
if ($preferTitle) {
// Protect our title from rewriting
$GLOBALS['mosConfig_pagetitles'] = '0';
}
unset($tags['title']);
}
/* START BATHCOMMS CODE */
// Description metatag
/*if (isset($tags['metadesc'])) {
if ($mosConfig_MetaDesc) $mosConfig_MetaDesc .= ', ';
$mosConfig_MetaDesc .= $tags['metadesc'];
unset($tags['metadesc']);
}*/
if (isset($tags['metadesc'])) {
if( ($rewriteDescription == '1') || ($mosConfig_MetaDesc == '') ) {
$mosConfig_MetaDesc = $tags['metadesc'];
}
else {
$mosConfig_MetaDesc .= ', ' . $tags['metadesc'];
}
$mainframe->addMetaTag('description', $mosConfig_Description);
$mosConfig_Description = '';
unset($tags['metadesc']);
}
/* END BATHCOMMS CODE */
// Keywords metatag
if (isset($tags['metakey'])) {
if( ($rewriteKeywords == '1') || ($mosConfig_MetaKeys == '') ) {
$mosConfig_MetaKeys = $tags['metakey'];
}
else {
$mosConfig_MetaKeys .= ', ' . $tags['metakey'];
}
$mainframe->addMetaTag('keywords', $mosConfig_MetaKeys);
$mosConfig_MetaKeys = '';
unset($tags['metakey']);
}
// Other metatags
foreach ($tags as $name => $content) {
$mainframe->appendMetaTag($name, $content);
}
}
}
?>
However the reason we are working on this is to get meta data into the VirtueMart pages (product and category) but it's just not working at all.
We've installed the VirtueMart extension for JoomSEF with no joy, what exactly does the extensions do? What versions of JoomSEF is it compatible with? Only 1.3.0 or 1.3.0+?