Wiki ⇒ Tips and Tricks ⇒ How to modify Meta Tags ⇒ CPG Dragonfly™ CMS
WikiTips and Tricks ⇒ How to modify Meta Tags

10. 8: How to modify Meta Tags Parent


You can adjust your meta tags by editing includes/meta.php and includes/cmsinit.inc

includes/cmsinit.inc
$METATAGS['description'] = $slogan;
$METATAGS['keywords'] = '';
$METATAGS['resource-type'] = 'document';
$METATAGS['distribution'] = 'global';
$METATAGS['author'] = $sitename;
$METATAGS['copyright'] = 'Copyright (c) '.date('Y').' by '.$sitename;
$METATAGS['robots'] = 'index, follow';
$METATAGS['rating'] = 'general';
$METATAGS['generator'] = 'CPG Dragonfly CMS: Copyright (c) 2003-'.date('Y').' by CPG-Nuke Development Team, www.dragonflycms.org';
//$METATAGS['revisit-after'] = '1 days';
$METATAGS['MSSmartTagsPreventParsing'] = 'true';

includes/meta.php
case 'News':
  $METATAGS['description'] = _NewsLANG." $slogan";
  $METATAGS['keywords'] .= ', ';
break;

Note that you can set per-module meta tags by editing the case statement for case 'modulename':

To edit the default tags, edit those in the default: case. These will show up where the module name is not listed in the case list.

You can also edit tags that appear globally in includes/cmsinit.inc (Search for "Set default metatags").

Do take care when playing with either file, since inducing a php error will likely result in a blank front page

Be sure to make a backup of each file before editing.

*** WARNING ***
DO NOT USE NOTEPAD.EXE TO EDIT THESE FILES. Editing these files with notepad will cause UTF-8 BOM issues which may cause hangs or other bad behavior by some browsers.

Just be aware that these are PHP files. The information is contained between 'single quotes' and those must remain intact or you will break things. You may use doublequotes (if they're allowed in the HTML spec), but not single quotes.

Example Code:

case 'Your_Account':
  $METATAGS['description'] = _Your_AccountLANG." $slogan";
  $METATAGS['keywords'] .= ', fast, secure, security, cms, content, management, system';

For example, you can modify the portion that says ", fast, secure, security, cms, content, management, system" as you like, so long as you retain the quotes.

Info Provided by: SaintPeter and Head-e

Video tutorial can be found HERE

Created: Thursday, March 24, 2005 (07:43:57) by Head-e
Updated: Tuesday, September 25, 2007 (03:39:22) by LilDevil