User Tools

Site Tools


This is an old revision of the document!

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

// 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)));

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

define('META_TAG_TITLE_CONTACT_US', 'This is the new custom title for the contact us page.');
/home/ladyada/public_html/wiki/data/attic/zencartmods/meta_tags.html.1315324766.txt.gz · Last modified: 2016/01/28 18:05 (external edit)