This shows you the differences between two versions of the page.
zencartmods:meta_tags.html [2011/09/06 15:59] daigo created |
zencartmods:meta_tags.html [2016/01/28 18:05] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | An easy feature to miss in the zen cart code is the ability to customize your meta tags for individual pages. | ||
- | For categories and products, the meta tag editors are nice and can be accessed by clicking button at the far right of the categories/products section. | ||
- | |||
- | For define pages (the static pages that aren't products - like "contact us"), it gets a little trickier. | ||
- | |||
- | In the /includes/modules/meta_tags.php file, you'll find code that looks like this | ||
- | <code php> | ||
- | // if per-page metatags overrides have been defined, use those, otherwise use usual defaults: | ||
- | if ($current_page_base != 'index') { | ||
- | if (defined('META_TAG_TITLE_' . strtoupper($current_page_base))) define('META_TAG_TITLE', constant('META_TAG_TITLE_' . strtoupper($current_page_base))); | ||
- | if (defined('META_TAG_DESCRIPTION_' . strtoupper($current_page_base))) define('META_TAG_DESCRIPTION', constant('META_TAG_DESCRIPTION_' . strtoupper($current_page_base))); | ||
- | if (defined('META_TAG_KEYWORDS_' . strtoupper($current_page_base))) define('META_TAG_KEYWORDS', constant('META_TAG_KEYWORDS_' . strtoupper($current_page_base))); | ||
- | } | ||
- | </code> | ||
- | |||
- | So these 3 meta tag fields can be customized, just not through the Admin. | ||
- | |||
- | So to create a custom title for a page like "Contact us", | ||
- | |||
- | Add this line into /includes/languages/english/contact_us.php | ||
- | <code php> | ||
- | define('META_TAG_TITLE_CONTACT_US', 'This is the new custom title for the contact us page.'); | ||
- | </code> |