1
comstock
Description meta tag
  • 2008/8/23 6:25

  • comstock

  • Just popping in

  • Posts: 6

  • Since: 2008/8/21


I have created a page per the faq:
include("mainfile.php");
include(
XOOPS_ROOT_PATH."/header.php");
$xoopsTpl->assign('xoops_pagetitle'"Title"); 
$xoopsTpl->assign('xoops_meta_description'"Here is a description" );
HERE IS MY CONTENT
 
php
include(XOOPS_ROOT_PATH."/footer.php");
?>


The title shows up in my page title on my browser. The description does not. I still see the sitewide description.

Should this work? Could someone point me in the right direction to have meta descriptions in "home made" pages (or in any of the static content modules)

2
trabis
Re: Description meta tag
  • 2008/8/23 7:55

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Try this:
include("mainfile.php");
include(
XOOPS_ROOT_PATH."/header.php");

$meta_keywords "test, page, meta";
$meta_description "test page meta";
$pagetitle "page title";

if(isset(
$xoTheme) && is_object($xoTheme)) {
    
$xoTheme->addMeta'meta''keywords'$meta_keywords);
    
$xoTheme->addMeta'meta''description'$meta_description);
} else {    
// Compatibility for old XOOPS versions
    
$xoopsTpl->assign('xoops_meta_keywords'$meta_keywords);
    
$xoopsTpl->assign('xoops_meta_description'$meta_description);
}

$xoopsTpl->assign('xoops_pagetitle'$pagetitle);
?>
HERE IS MY CONTENT
 include(XOOPS_ROOT_PATH."/footer.php");
?>

3
comstock
Re: Description meta tag
  • 2008/8/23 17:54

  • comstock

  • Just popping in

  • Posts: 6

  • Since: 2008/8/21


Spectacular!
This works perfectly
Your assistance is greatly appreciated.
-Joe

Login

Who's Online

235 user(s) are online (48 user(s) are browsing Support Forums)


Members: 0


Guests: 235


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Sep 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits