Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2009
    Posts
    78
    Plugin Contributions
    0

    Default Can I add the category name to my Title meta tag?

    Hi,

    My website address is here; www.cartamagicastore.com

    I would like to add the category name, have the name of the store without the tagline and remove the price in my title tag to get this as a title:
    Product name (remove price) | Category name | Store name (remove tagline)

    I think I have to change the module/meta-tags.php file, but I have nowhere near enough experience in php to make some modifications to this file, and I am not sure how to add the category.

    Could someone help me please ? Thanks in advance !

    Here is the code in my meta-tags.php file:
    Code:
    <?php
    /**
     * meta_tags module
     *
     * @package modules
     * @copyright Copyright 2003-2006 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: meta_tags.php 4960 2006-11-20 01:46:46Z drbyte $
     */
    if (!defined('IS_ADMIN_FLAG')) {
      die('Illegal Access');
    }
    // This should be first line of the script:
    $zco_notifier->notify('NOTIFY_MODULE_START_META_TAGS');
    
    
    /////////////////////////////////////////////////////////
    // Moved to /includes/languages/english/meta_tags.php
    //
    // Define Primary Section Output
    //  define('PRIMARY_SECTION', ' : ');
    
    // Define Secondary Section Output
    //  define('SECONDARY_SECTION', ' - ');
    
    // Define Tertiary Section Output
    //  define('TERTIARY_SECTION', ', ');
    
    //
    /////////////////////////////////////////////////////////
    
    // Add tertiary section to site tagline
    if (strlen(SITE_TAGLINE) > 1) {
      define('TAGLINE', TERTIARY_SECTION . SITE_TAGLINE);
    } else {
      define('TAGLINE', '');
    }
    
    $review_on = "";
    $keywords_string_metatags = "";
    $meta_tags_over_ride = false;
    if (!defined('METATAGS_DIVIDER')) define('METATAGS_DIVIDER', ' ');
    
    // Get all top category names for use with web site keywords
    $sql = "select cd.categories_name from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = 0 and c.categories_id = cd.categories_id and cd.language_id='" . (int)$_SESSION['languages_id'] . "' and c.categories_status=1";
    $keywords_metatags = $db->Execute($sql);
    while (!$keywords_metatags->EOF) {
      $keywords_string_metatags .= $keywords_metatags->fields['categories_name'] . METATAGS_DIVIDER;
      $keywords_metatags->MoveNext();
    }
    define('KEYWORDS', str_replace('"','',zen_clean_html($keywords_string_metatags) . CUSTOM_KEYWORDS));
    
    // Get different meta tag values depending on main_page values
    switch ($_GET['main_page']) {
      case 'advanced_search':
      case 'account_edit':
      case 'account_history':
      case 'account_history_info':
      case 'account_newsletters':
      case 'account_notifications':
      case 'account_password':
      case 'address_book':
      define('META_TAG_TITLE', HEADING_TITLE . PRIMARY_SECTION . TITLE . TAGLINE);
      define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . NAVBAR_TITLE_1 . SECONDARY_SECTION . KEYWORDS);
      define('META_TAG_KEYWORDS', KEYWORDS . METATAGS_DIVIDER . NAVBAR_TITLE_1);
      break;
    
      case 'address_book_process':
      define('META_TAG_TITLE', NAVBAR_TITLE_ADD_ENTRY . PRIMARY_SECTION . TITLE . TAGLINE);
      define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . NAVBAR_TITLE_ADD_ENTRY . SECONDARY_SECTION . KEYWORDS);
      define('META_TAG_KEYWORDS', KEYWORDS . METATAGS_DIVIDER . NAVBAR_TITLE_ADD_ENTRY);
      break;
    
      case 'advanced_search_result':
      case 'password_forgotten':
      define('META_TAG_TITLE', NAVBAR_TITLE_2 . PRIMARY_SECTION . TITLE . TAGLINE);
      define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . NAVBAR_TITLE_2 . SECONDARY_SECTION . KEYWORDS);
      define('META_TAG_KEYWORDS', KEYWORDS . METATAGS_DIVIDER . NAVBAR_TITLE_2);
      break;
    
      case 'checkout_confirmation':
      case 'checkout_payment':
      case 'checkout_payment_address':
      case 'checkout_shipping':
      case 'checkout_success':
      case 'create_account_success':
      define('META_TAG_TITLE', HEADING_TITLE . PRIMARY_SECTION . TITLE . TAGLINE);
      define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . HEADING_TITLE . SECONDARY_SECTION . KEYWORDS);
      define('META_TAG_KEYWORDS', KEYWORDS . METATAGS_DIVIDER . HEADING_TITLE);
      break;
    
      case 'index':
      // bof: categories meta tags
      // run custom categories meta tags
      $sql = "select * from " . TABLE_METATAGS_CATEGORIES_DESCRIPTION . " mcd where mcd.categories_id = '" . (int)$current_category_id . "' and mcd.language_id = '" . (int)$_SESSION['languages_id'] . "'";
      $category_metatags = $db->Execute($sql);
      if (!$category_metatags->EOF) {
        define('META_TAG_TITLE', str_replace('"','',$category_metatags->fields['metatags_title']));
        define('META_TAG_DESCRIPTION', str_replace('"','',$category_metatags->fields['metatags_description']));
        define('META_TAG_KEYWORDS', str_replace('"','',$category_metatags->fields['metatags_keywords']));
      } else {
        // build categories meta tags
        // eof: categories meta tags
        if ($category_depth == 'nested') {
          $sql = "select cd.categories_name from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$_SESSION['languages_id'] . "' and c.categories_status=1";
          $category_metatags = $db->Execute($sql);
          if ($category_metatags->EOF) {
            $meta_tags_over_ride = true;
          } else {
            define('META_TAG_TITLE', str_replace('"','',$category_metatags->fields['categories_name'] . PRIMARY_SECTION . TITLE . TAGLINE));
            define('META_TAG_DESCRIPTION', str_replace('"','',TITLE . PRIMARY_SECTION . $category_metatags->fields['categories_name'] . SECONDARY_SECTION . KEYWORDS));
            define('META_TAG_KEYWORDS', str_replace('"','',KEYWORDS . METATAGS_DIVIDER . $category_metatags->fields['categories_name']));
          } // EOF
        } elseif ($category_depth == 'products') {
          if (isset($_GET['manufacturers_id']) || ((isset($_GET['filter_id']) && $_GET['filter_id'] > 0) && isset($_GET['cPath'])) ) {
            if ((isset($_GET['filter_id']) && isset($_GET['cPath'])) ) {
              $include_manufacturers_id = $_GET['filter_id'];
            } else {
              $include_manufacturers_id = $_GET['manufacturers_id'];
            }
            $sql = "select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$include_manufacturers_id . "'";
            $manufacturer_metatags = $db->Execute($sql);
            if ($manufacturer_metatags->EOF) {
              $meta_tags_over_ride = true;
            } else {
              define('META_TAG_TITLE', str_replace('"','',$manufacturer_metatags->fields['manufacturers_name'] . PRIMARY_SECTION . TITLE . TAGLINE));
              define('META_TAG_DESCRIPTION', str_replace('"','',TITLE . PRIMARY_SECTION . $manufacturer_metatags->fields['manufacturers_name'] . SECONDARY_SECTION . KEYWORDS));
              define('META_TAG_KEYWORDS', str_replace('"','', $manufacturer_metatags->fields['manufacturers_name'] . METATAGS_DIVIDER . KEYWORDS));
            } // EOF
          } else {
            $sql = "select cd.categories_name from " . TABLE_CATEGORIES . ' c, ' . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$_SESSION['languages_id'] . "' and c.categories_status=1";
            $category_metatags = $db->Execute($sql);
            if ($category_metatags->EOF) {
              $meta_tags_over_ride = true;
            } else {
              define('META_TAG_TITLE', str_replace('"','',$category_metatags->fields['categories_name'] . PRIMARY_SECTION . TITLE . TAGLINE));
              define('META_TAG_DESCRIPTION', str_replace('"','',TITLE . PRIMARY_SECTION . $category_metatags->fields['categories_name'] . SECONDARY_SECTION . KEYWORDS));
              define('META_TAG_KEYWORDS', str_replace('"','',KEYWORDS . METATAGS_DIVIDER . $category_metatags->fields['categories_name']));
            } // EOF
          }
        } else {
          if (isset($_GET['manufacturers_id'])) {
            $sql = "select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'";
            $manufacturer_metatags = $db->Execute($sql);
            if ($manufacturer_metatags->EOF) {
              define('META_TAG_TITLE', TITLE . TAGLINE);
              define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . str_replace(array("'",'"'),'',strip_tags(HEADING_TITLE)) . SECONDARY_SECTION . KEYWORDS);
              define('META_TAG_KEYWORDS', KEYWORDS . METATAGS_DIVIDER . str_replace(array("'",'"'),'',strip_tags(HEADING_TITLE)));
            } else {
              define('META_TAG_TITLE', str_replace('"','', $manufacturer_metatags->fields['manufacturers_name'] . PRIMARY_SECTION . TITLE . TAGLINE));
              define('META_TAG_DESCRIPTION', str_replace('"','',TITLE . PRIMARY_SECTION . $manufacturer_metatags->fields['manufacturers_name'] . SECONDARY_SECTION . KEYWORDS));
              define('META_TAG_KEYWORDS', str_replace('"','', $manufacturer_metatags->fields['manufacturers_name'] . METATAGS_DIVIDER . KEYWORDS));
            }
          } else {
            // nothing custom main page
            $meta_tags_over_ride = true;
          }
        }
      } // custom meta tags
      break;
      // eof: categories meta tags
    
      case 'popup_image':
      $meta_products_name = str_replace('"','',zen_clean_html($products_values->fields['products_name']));
      define('META_TAG_TITLE', $meta_products_name . PRIMARY_SECTION . TITLE . TAGLINE);
      define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . $meta_products_name . SECONDARY_SECTION . KEYWORDS);
      define('META_TAG_KEYWORDS', KEYWORDS . METATAGS_DIVIDER . $meta_products_name);
      break;
    
      case 'popup_image_additional':
      $meta_products_name = str_replace('"','',zen_clean_html($products_values->fields['products_name']));
      define('META_TAG_TITLE', $meta_products_name . PRIMARY_SECTION . TITLE . TAGLINE);
      define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . $meta_products_name . SECONDARY_SECTION . KEYWORDS);
      define('META_TAG_KEYWORDS', KEYWORDS . METATAGS_DIVIDER . $meta_products_name);
      break;
    
      case 'popup_search_help':
      define('META_TAG_TITLE', HEADING_SEARCH_HELP . PRIMARY_SECTION . TITLE . TAGLINE);
      define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . HEADING_SEARCH_HELP . SECONDARY_SECTION . KEYWORDS);
      define('META_TAG_KEYWORDS', KEYWORDS . METATAGS_DIVIDER . HEADING_SEARCH_HELP);
      break;
    
      // unless otherwise required product_reviews uses the same settings as product_reviews_info and other _info pages
      case 'product_reviews':
      // unless otherwise required product_reviews_info uses the same settings as reviews and other _info pages
      case 'product_reviews_info':
      $review_on = META_TAGS_REVIEW;
      //  case 'product_info':
      case (strstr($_GET['main_page'], 'product_') or strstr($_GET['main_page'], 'document_')):
      /*
      $sql = "select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_price, p.products_tax_class_id, p.product_is_free, p.products_price_sorter,
      p.metatags_title_status, p.metatags_products_name_status, p.metatags_model_status, p.metatags_price_status, p.metatags_title_tagline_status,
      mtpd.metatags_title, mtpd.metatags_keywords, mtpd.metatags_description from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_META_TAGS_PRODUCTS_DESCRIPTION . " mtpd where p.products_status = 1 and p.products_id = '" . (int)$_GET['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' and mtpd.products_id = p.products_id and mtpd.language_id = '" . (int)$_SESSION['languages_id'] . "'";
      */
    
      $sql= "select pd.products_name, p.products_model, p.products_price_sorter, p.products_tax_class_id,
                                          p.metatags_title_status, p.metatags_products_name_status, p.metatags_model_status,
                                          p.products_id, p.metatags_price_status, p.metatags_title_tagline_status,
                                          pd.products_description, p.product_is_free,
                                          mtpd.metatags_title, mtpd.metatags_keywords, mtpd.metatags_description
                                  from (" . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd) left join " . TABLE_META_TAGS_PRODUCTS_DESCRIPTION . " mtpd on mtpd.products_id = p.products_id and mtpd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                                  where p.products_id = '" . (int)$_GET['products_id'] . "'
                                  and p.products_id = pd.products_id
                                  and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";
    
      $product_info_metatags = $db->Execute($sql);
      if ($product_info_metatags->EOF) {
        $meta_tags_over_ride = true;
      } else {
        // custom meta tags per product
        if (!empty($product_info_metatags->fields['metatags_keywords']) or !empty($product_info_metatags->fields['metatags_description'])) {
          $meta_products_name = '';
          $meta_products_price = '';
          $metatags_keywords = '';
    
          $meta_products_price = ($product_info_metatags->fields['metatags_price_status'] == '1' ? SECONDARY_SECTION . ($product_info_metatags->fields['products_price_sorter'] > 0 ? $currencies->display_price($product_info_metatags->fields['products_price_sorter'], zen_get_tax_rate($product_info_metatags->fields['products_tax_class_id'])) : SECONDARY_SECTION . META_TAG_PRODUCTS_PRICE_IS_FREE_TEXT) : '');
    
          $meta_products_name .= ($product_info_metatags->fields['metatags_products_name_status'] == '1' ? $product_info_metatags->fields['products_name'] : '');
          $meta_products_name .= ($product_info_metatags->fields['metatags_title_status'] == '1' ? ' ' . $product_info_metatags->fields['metatags_title'] : '');
          $meta_products_name .= ($product_info_metatags->fields['metatags_model_status'] == '1' ? ' [' . $product_info_metatags->fields['products_model'] . ']' : '');
          if (zen_check_show_prices() == true) {
            $meta_products_name .= $meta_products_price;
          }
          $meta_products_name .= ($product_info_metatags->fields['metatags_title_tagline_status'] == '1' ? PRIMARY_SECTION . TITLE . TAGLINE : '');
    
          if (!empty($product_info_metatags->fields['metatags_description'])) {
            // use custom description
            $metatags_description = $product_info_metatags->fields['metatags_description'];
          } else {
            // no custom description defined use product_description
            $metatags_description = zen_truncate_paragraph(strip_tags(stripslashes($product_info_metatags->fields['products_description'])), MAX_META_TAG_DESCRIPTION_LENGTH);
          }
    
          $metatags_description = zen_clean_html($metatags_description);
    
          if (!empty($product_info_metatags->fields['metatags_keywords'])) {
            // use custom keywords
            $metatags_keywords = $product_info_metatags->fields['metatags_keywords'] . METATAGS_DIVIDER . CUSTOM_KEYWORDS;  // CUSTOM skips categories
          } else {
            // no custom keywords defined use product_description
            $metatags_keywords = KEYWORDS . METATAGS_DIVIDER . $meta_products_name . METATAGS_DIVIDER;
          }
    
          define('META_TAG_TITLE', str_replace('"','',$review_on . $meta_products_name));
          define('META_TAG_DESCRIPTION', str_replace('"','',$metatags_description . ' '));
          define('META_TAG_KEYWORDS', str_replace('"','',$metatags_keywords));  // KEYWORDS and CUSTOM_KEYWORDS are added above
    
        } else {
          // build un-customized meta tag
          if (META_TAG_INCLUDE_PRICE == '1' and !strstr($_GET['main_page'], 'document_general')) {
            if ($product_info_metatags->fields['product_is_free'] != '1') {
              if (zen_check_show_prices() == true) {
                $meta_products_price = zen_get_products_actual_price($product_info_metatags->fields['products_id']);
                $meta_products_price = SECONDARY_SECTION . $currencies->display_price($meta_products_price, zen_get_tax_rate($product_info_metatags->fields['products_tax_class_id']));
              }
            } else {
              $meta_products_price = SECONDARY_SECTION . META_TAG_PRODUCTS_PRICE_IS_FREE_TEXT;
            }
          } else {
            $meta_products_price = '';
          }
    
          if (META_TAG_INCLUDE_MODEL == '1' && zen_not_null($product_info_metatags->fields['products_model'])) {
            $meta_products_name = $product_info_metatags->fields['products_name'] . ' [' . $product_info_metatags->fields['products_model'] . ']';
          } else {
            $meta_products_name = $product_info_metatags->fields['products_name'];
          }
          $meta_products_name = zen_clean_html($meta_products_name);
    
          $products_description = zen_truncate_paragraph(strip_tags(stripslashes($product_info_metatags->fields['products_description'])), MAX_META_TAG_DESCRIPTION_LENGTH);
    
          $products_description = zen_clean_html($products_description);
    
          define('META_TAG_TITLE', str_replace('"','',$review_on . $meta_products_name . $meta_products_price . PRIMARY_SECTION . TITLE . TAGLINE));
          define('META_TAG_DESCRIPTION', str_replace('"','',TITLE . ' ' . $meta_products_name . SECONDARY_SECTION . $products_description . ' '));
          define('META_TAG_KEYWORDS', str_replace('"','',$meta_products_name . METATAGS_DIVIDER . KEYWORDS));
    
        } // CUSTOM META TAGS
      } // EOF
      break;
    
      case 'product_reviews_info_OFF':
      $sql = "select rd.reviews_text, r.reviews_rating, r.reviews_id, r.customers_name, p.products_id, p.products_price, p.products_tax_class_id, p.products_model, pd.products_name, p.product_is_free from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where r.reviews_id = '" . (int)$_GET['reviews_id'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$_SESSION['languages_id'] . "' and r.products_id = p.products_id and p.products_status = 1 and p.products_id = pd.products_id and pd.language_id = '". (int)$_SESSION['languages_id'] . "'";
      $review_metatags = $db->Execute($sql);
      if ($review_metatags->EOF) {
        $meta_tags_over_ride = true;
      } else {
        if (META_TAG_INCLUDE_PRICE == '1') {
          if ($review_metatags->fields['product_is_free'] != '1') {
            $meta_products_price = zen_get_products_actual_price($review_metatags->fields['products_id']);
            $meta_products_price = SECONDARY_SECTION . $currencies->display_price($meta_products_price, zen_get_tax_rate($review_metatags->fields['products_tax_class_id']));
          } else {
            $meta_products_price = SECONDARY_SECTION . META_TAG_PRODUCTS_PRICE_IS_FREE_TEXT;
          }
        } else {
          $meta_products_price = '';
        }
    
        if (zen_not_null($review_metatags->fields['products_model'])) {
          $meta_products_name = $review_metatags->fields['products_name'] . ' [' . $review_metatags->fields['products_model'] . ']';
        } else {
          $meta_products_name = $review_metatags->fields['products_name'];
        }
    
        $meta_products_name = zen_clean_html($meta_products_name);
    
        $review_text_metatags = substr(strip_tags(stripslashes($review_metatags->fields['reviews_text'])), 0, 60);
        $reviews_rating_metatags = SUB_TITLE_RATING . ' ' . sprintf(TEXT_OF_5_STARS, $review_metatags->fields['reviews_rating']);
        define('META_TAG_TITLE', str_replace('"','',$meta_products_name . $meta_products_price . PRIMARY_SECTION . TITLE . TERTIARY_SECTION . NAVBAR_TITLE));
        define('META_TAG_DESCRIPTION', str_replace('"','',TITLE . PRIMARY_SECTION . NAVBAR_TITLE . SECONDARY_SECTION . $meta_products_name . SECONDARY_SECTION . $review_metatags->fields['customers_name'] . SECONDARY_SECTION . $review_text_metatags . ' ' . SECONDARY_SECTION . $reviews_rating_metatags));
        define('META_TAG_KEYWORDS', str_replace('"','',KEYWORDS . METATAGS_DIVIDER . $meta_products_name . METATAGS_DIVIDER . $review_metatags->fields['customers_name'] . METATAGS_DIVIDER . $reviews_rating_metatags));
      } // EOF
      break;
    
      default:
      define('META_TAG_TITLE', (defined('NAVBAR_TITLE') ? NAVBAR_TITLE . PRIMARY_SECTION : '') . TITLE . TAGLINE);
      define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . (defined('NAVBAR_TITLE') ? NAVBAR_TITLE : '' ) . SECONDARY_SECTION . KEYWORDS);
      define('META_TAG_KEYWORDS', KEYWORDS . METATAGS_DIVIDER . (defined('NAVBAR_TITLE') ? NAVBAR_TITLE : '' ) );
    }
    
    // meta tags override due to 404, missing products_id, cPath or other EOF issues
    if ($meta_tags_over_ride == true) {
      define('META_TAG_TITLE', (defined('NAVBAR_TITLE') ? NAVBAR_TITLE . PRIMARY_SECTION : '') . TITLE . TAGLINE);
      define('META_TAG_DESCRIPTION', TITLE . (defined('NAVBAR_TITLE') ? PRIMARY_SECTION . NAVBAR_TITLE : '') . SECONDARY_SECTION . KEYWORDS);
      define('META_TAG_KEYWORDS', KEYWORDS . METATAGS_DIVIDER . (defined('NAVBAR_TITLE') ? NAVBAR_TITLE : ''));
    }
    
    // This should be last line of the script:
    $zco_notifier->notify('NOTIFY_MODULE_END_META_TAGS');
    ?>

  2. #2
    Join Date
    Feb 2009
    Posts
    78
    Plugin Contributions
    0

    Default Re: Adding the category name to my Title meta tag

    Please, anybody ?

  3. #3
    Join Date
    Feb 2009
    Posts
    78
    Plugin Contributions
    0

    Default Re: Adding the category name to my Title meta tag

    Can somene please elp me with this ?

  4. #4
    Join Date
    Jan 2008
    Posts
    73
    Plugin Contributions
    0

    Default Re: Can I add the category name to my Title meta tag?

    On the Admin side you can turn on/off price and such by going to Configuration > Product Info > Meta Tags - Include Product Model in Title and choosing on or off, some of the others will have to be hard coded, which I am of no help with that part

  5. #5
    Join Date
    Jan 2008
    Posts
    31
    Plugin Contributions
    0

    Default Re: Can I add the category name to my Title meta tag?

    I am no expert but I am working on something like. I have spent a lot of time learning what others more experienced must already know.
    Firstly, this is how it works
    Includes\language\English\your_store\meta_tags. Meta tag elements are defined here by you. TITLE, SITE_TAGLINE, CUSTOM_KEYWORDS etc. etc. I call these the elements.

    Includes\modules\your_store\meta_tags.php includes the rules for combining elements to make meta tags for each page (as you have pointed out).

    NOTE: What you need may already be available, as you did not say which pages you wanted that behavior. (Home page may not have categories, for example and similarly for many other pages).

    If you want to know exactly how it is behaving now then follow these instructions and all will become clear:

    define TITLE as ***Title meta tag***, CUSTOM_KEYWORDS as *** Custom Keywords *** etc.

    LOOK-SEE-STEP:
    Now in Mozilla Firefox browser look at the source code for any page you want and you will see what tags appear on each page.

    In your admin: go to your categories and add similar names as follows, *** Category shoes name***, ***Category socks name ***,
    Do similarly for the description i.e. *** Category Shoes description *** etc.
    Now go to the meta data and do likewise i.e. *** Cat shoes meta name***, Cat shoes meta desc.***
    Do the same for a product also.
    Now repeat the LOOK-SEE-STEP: and you can see exactly how your meta data is being composed for every page.
    The behavior changes depending on whether you have the meta description/title/keywords completed for a given category or product or not, so don't shortcut it.

    I recorded what I got for each type of page until I could see the whole picture. I would show you but it is a grid and I do not know how to include it here.
    I can tell you this as a limited example..
    For a category page the title meta tag will be the meta tag category title so you can make it absolutely exactly what you want
    Product meta tag title works out as (Product title+Product Meta Tag title+[p/n X] : +TITLE+TAGLINE)
    As I say, you can see this and more by following my instructions.

    If you cannot get everything you want by making changes in admin then you will need to modify Includes\modules\your_store\meta_tags.php. That's where I am at but, like you, I never heard of php till a while ago.
    Hope that helps amigo.

  6. #6
    Join Date
    Feb 2008
    Posts
    1,336
    Plugin Contributions
    1

    Default Re: Can I add the category name to my Title meta tag?

    What a confusing explanation.

    Best way is to actually write meta tags for each page you want this on. There are limits on what you can do with the admin. Otherwise you want to edit modules/meta_tags.php if you are not good with php and Zen Cart structure then doing it manually would be the best way. From now on you can do the meta tags when adding the products so you don't have a lot of them to do.

 

 

Similar Threads

  1. Replies: 0
    Last Post: 24 Jun 2008, 06:54 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR