Before it became std (or I just didn't figure it), I did my own thing, ie:
1. create 2 x UDT's ie "description" and "keywords"
Description UDT:
Code: Select all
global $gCms;
$smarty = &$gCms->GetSmarty();
if ($params['content'] && $params['content'] != '')
{
$smarty->assign ( "metadescription", $params['content'] );
}
else
{
return;
}
and "keywords" UDT.
Code: Select all
global $gCms;
$smarty = &$gCms->GetSmarty();
if ($params['content'] && $params['content'] != '')
{
$smarty->assign ( "keywords", $params['content'] );
$x= str_replace(',', ' ',$params['content']);
if ( str_word_count($x) > 5) {
$y = explode (',',$params['content']);
$titlekeywords = ucwords ($y[0] . " " . $y[1] . " " . $y[2] . " " . $y[3] . " " . $y[4]);
} else {
$titlekeywords = $x;
}
$smarty->assign ( "titlekeywords",ucwords($titlekeywords) );
} else {
return;
}
"keywords" UDT is slightly different to "description" UDT as many clients want to go overboard with the number of keywords so var "titlekeywords" limits it to the first 5 words.
On each page I use in the
Smarty data or logic that is specific to this page:
{description content="blah blah blah"}
{keywords content="site,keywords,whatever,and so on, etc, however many..."}
In the
Page Specific Metadata text area add:
and add the {$titlekeywords} and {$metadescription} tags wherever I want in the template not just as meta tags, eg as the alt text for the header banner image, in the page title and with 'class='accessibility' in the footer.
I also add a Global Content Block and 'if' statement in the template that says if there is no page specific metadescription or keywords, use the default GCB text.
No doubt it's the long way round but seems to work for me and Google.
HTH
psy