Dieses Dokuwiki verwendet ein von Anymorphic Webdesign erstelltes Thema.

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

custom_meta_tags [2008/04/10 23:07] (current)
Line 1: Line 1:
 +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 :
 +
 +<code php>// 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;
 +</​code>​
 +
 +Enter your custom keywords between the single quotes, comma separated, like this:
 +
 +<code php>​$mt_extra_keywords = '​keyword1,​word2,​word3';</​code>​
 +
 +
 +==== Add Custom Text ====
 +Next, to add your own custom text, you can add it to this section:
 +
 +<code php>// Define Primary Section Output
 +define('​PRIMARY_SECTION',​ ' : ');
 +define('​TITLE',​ 'AABox Web Hosting'​);​
 +// Define Secondary Section Output
 +define('​SECONDARY_SECTION',​ ' - '​);</​code>​
 +
 +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:
 +
 +<code php>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;</​code>​
 +
 +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:
 +
 +<code php>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;</​code>​
 +
 +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:
 +
 +<code php>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;
 +</​code>​
 +
 +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.
  
custom_meta_tags.txt ยท Last modified: 2008/04/10 23: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