Thanks for the pointer but it does not work.
To includes/joomla.php I added
Code:
/**
* @param string The value of the name attibute
* @param string The value of the content attibute to append to the existing
* Replaces the corresponding Meta Tag with the new contents
*/
function replaceMetaTag( $name, $content ) {
$name = trim( htmlspecialchars( $name ) );
$n = count( $this->_head['meta'] );
for ($i = 0; $i < $n; $i++) {
if ($this->_head['meta'][$i][0] == $name) {
$content = trim( htmlspecialchars( $content ) );
$this->_head['meta'][$i][1] = $content ;
return;
}
}
$this->addMetaTag( $name , $content );
}
I replaced the corresponding section of components/com_content/content.html.php with
Code:
//$mainframe->appendMetaTag( 'description', $row->metadesc );
//$mainframe->appendMetaTag( 'keywords', $row->metakey );
$mainframe->replaceMetaTag( 'description', $row->metadesc );
$mainframe->replaceMetaTag( 'keywords', $row->metakey );
and I replaced the corresponding section of mosShowHead() in includes/frontend.php with
Code:
//$mainframe->appendMetaTag( 'description', $mosConfig_MetaDesc );
//$mainframe->appendMetaTag( 'keywords', $mosConfig_MetaKeys );
$mainframe->replaceMetaTag( 'description', $mosConfig_MetaDesc );
$mainframe->replaceMetaTag( 'keywords', $mosConfig_MetaKeys );
The problem is that mosShowHead is called last and the meta description tag is always the one in my configuration file, even for the content items. I need a way of knowing if I am in the front page (first item of the main menu) or viewing a content item to fine tune mosShowHead to only replace the meta tag in the front page
Thanks for pointing me in the right direction
_________________
Caminante no hay camino, se hace camino al andar. Al echar la vista atrás se ve la senda que nunca se ha de volver a pisar. Golpe a golpe, verso a verso.
If I stumble and do not fall, I advance
http://andreso.nethttp://megustafumar.org