Dieses Dokuwiki verwendet ein von Anymorphic Webdesign erstelltes Thema.

How to edit the dynamic meta tags in osCMax

The file you edit is: /catalog/includes/meta_tags.php

Add Custom Keywords

The code you are concerned with is :

// Optional customization options for each language
switch ($languages_id) {
// English language
case '1':
//Extra keywords that will be outputted on every page
$mt_extra_keywords = '';
///Descriptive tagline of your web site
$web_site_tagline = TERTIARY_SECTION . '';
break;

Enter your custom keywords between the single quotes, comma separated, like this:

$mt_extra_keywords = 'keyword1,word2,word3';

Add Custom Text

Next, to add your own custom text, you can add it to this section:

// Define Primary Section Output
define('PRIMARY_SECTION', ' : ');
define('TITLE', 'AABox Web Hosting');
// Define Secondary Section Output
define('SECONDARY_SECTION', ' - ');

Enter your text between the single quotes, replacing AABox Web Hosting from the above example with your custom text.

This will add keywords and custom text site-wide.

Custom Text on individual pages

To add customization to single pages, scroll down the meta_tags.php file and edit the individual page settings. For example:

case CONTENT_INDEX_DEFAULT:
define('META_TAG_TITLE', TITLE . PRIMARY_SECTION . HEADING_TITLE . $web_site_tagline);
define('META_TAG_DESCRIPTION', 'custom text here ' . TITLE . PRIMARY_SECTION . HEADING_TITLE . SECONDARY_SECTION . WEB_SITE_KEYWORDS);
define('META_TAG_KEYWORDS', WEB_SITE_KEYWORDS . HEADING_TITLE);
break;

If you replace the 'custom text here ' from the above example with your own custom text, it will display that custom text on the index_default page only.

Simply add the custom text in whichever case you want to add to. You can place the custom text in any of the defined variables like this:

case CONTENT_INDEX_DEFAULT:
define('META_TAG_TITLE', TITLE . PRIMARY_SECTION . HEADING_TITLE . $web_site_tagline);
define('META_TAG_DESCRIPTION', 'custom text here ' . TITLE . PRIMARY_SECTION . HEADING_TITLE . SECONDARY_SECTION . 'custom text here too' . WEB_SITE_KEYWORDS);
define('META_TAG_KEYWORDS', 'custom,keywords,here' . WEB_SITE_KEYWORDS . HEADING_TITLE);
break;

Finally, if you want to remove any of the dynamic items, simply remove the variable that corresponds to the dynamic meta info that you want removed from the tag. For instance, to remove the dynamically generated meta description from the index.php page:

case CONTENT_INDEX_DEFAULT:
define('META_TAG_TITLE', TITLE . PRIMARY_SECTION . HEADING_TITLE . $web_site_tagline);
define('META_TAG_DESCRIPTION', 'custom text here ' . TITLE . PRIMARY_SECTION . HEADING_TITLE . SECONDARY_SECTION . 'custom text here too' . WEB_SITE_KEYWORDS);
define('META_TAG_KEYWORDS', 'custom,keywords,here' . WEB_SITE_KEYWORDS . HEADING_TITLE);
break;

Removing the code . TITLE . PRIMARY_SECTION . HEADING_TITLE . SECONDARY_SECTION and . WEB_SITE_KEYWORDS from tha above example will remove all dynamic meta content from the META_TAG_DESCRIPTION. This corresponds to the meta_description html tag. It will just contain your custom content, and not any dynamically generated content.

  • Bookmark at
  • Bookmark "Add Custom Keywords" at Reddit
  • Bookmark "Add Custom Keywords" at Google
  • Bookmark "Add Custom Keywords" at Facebook
  • Bookmark "Add Custom Keywords" at Twitter
  • Bookmark "Add Custom Keywords" at Slashdot
custom_meta_tags.txt ยท Last modified: 2008/04/10 21:07 (external edit)
You are here: startcustom_meta_tags
Dieses Dokuwiki verwendet ein von Anymorphic Webdesign erstelltes Thema.
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0