1
It's very hard to index in Google page without meta description. The problem is that Classifieds uses meta description that is default in XOOPS for every page. This is wrong, so here is a little hack for it.
Step 1:
Open modules/classifieds/index.php in editor
Step 2: Add meta description for categories
Find:
$xoopsTpl->assign('cat_desc',$cat_desc);
and under
$xoopsTpl->assign('xoops_pagetitle',$title);
add this code
// meta description tags for categories
$cat_desc_clean = strip_tags($cat_desc, '');
$xoTheme->addMeta('meta', 'description', "$title ".substr($cat_desc_clean,0,150));
Step 3: Add meta description for every ad
search for this (it's around line 700)
$xoopsTpl->assign('desctext', $desctext);
and under
$xoopsTpl->assign('xoops_pagetitle',"$title $ctitle - $type");
add this code
// meta description tags for ads
$desctextclean = strip_tags($desctext, '');
$xoTheme->addMeta('meta', 'description', "$title $ctitle $type $price $typeprice".substr($desctextclean,0,120));
It works for me :)
Thanks Ghia for help in
this topic.
Also check out
Classifieds + Fancybox.
Tell me how does this meta description hack works on full working website, coz I've test it localhost, but you have nothing to lose - any specific meta description is better than none :)
AFAIK the meta description should be about 150 characters, so you can change it in ".substr($desctextclean,0,
120)" cause first we add in description title and price and then description. Also i think that this should remove html tags from description [in case of using html editor for description].
Bye
P.S. This hack maybe need some polish, so if anyone have better idea, feel free to post it here :)