osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 
 

Category description in meta tags?

This is a discussion on Category description in meta tags? within the osCMax v2 Customization/Mods forums, part of the osCMax v2.0 Forums category; Ok I have searched the forum to death, but cannot find any answer to this. Is there anyway to have ...


Go Back   osCommerce and osCMax shopping cart software forums > osCMax v2.0 Forums > osCMax v2 Customization/Mods

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Reply

 

LinkBack Thread Tools
  #1  
Old 01-07-2008, 06:11 AM
New Member
 
Join Date: Nov 2007
Posts: 5
Thanks: 0
Thanked 4 Times in 2 Posts
Rep Power: 0
Interceptor is on a distinguished road
Default Category description in meta tags?

Ok I have searched the forum to death, but cannot find any answer to this.

Is there anyway to have the dynamic meta tags create description tags for the Category pages aswell?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Advertisement
  #2  
Old 01-10-2008, 03:45 AM
New Member
 
Join Date: Nov 2007
Posts: 5
Thanks: 0
Thanked 4 Times in 2 Posts
Rep Power: 0
Interceptor is on a distinguished road
Default Re: Category description in meta tags?

Ok so i'm now a bit chuffed with myself to finding the solution

However I still need a bit of help stripping the html out of the category description which shows up in the meta tags.

So heres my modified code for meta_tags.php

PHP Code:
case CONTENT_INDEX_PRODUCTS:
    if (isset(
$HTTP_GET_VARS['manufacturers_id'])) {
   
$mt_manufacturer_query tep_db_query("select manufacturers_name from " TABLE_MANUFACTURERS " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
      
$mt_manufacturer tep_db_fetch_array($mt_manufacturer_query);
   
define('META_TAG_TITLE'$mt_manufacturer['manufacturers_name'] . PRIMARY_SECTION TITLE $web_site_tagline);
   
define('META_TAG_DESCRIPTION'TITLE PRIMARY_SECTION $mt_manufacturer['manufacturers_name']) . SECONDARY_SECTION WEB_SITE_KEYWORDS;
   
define('META_TAG_KEYWORDS'WEB_SITE_KEYWORDS $mt_manufacturer['manufacturers_name']);
 } else {
      
$mt_category_query tep_db_query ("select categories_name, categories_description, categories_heading_title from " TABLE_CATEGORIES_DESCRIPTION " where categories_id = '" . (int)$current_category_id "' and language_id = '" . (int)$languages_id "'");
      
$mt_category tep_db_fetch_array($mt_category_query);
   
define('META_TAG_TITLE'$mt_category['categories_name'] . PRIMARY_SECTION TITLE $web_site_tagline);
   
define('META_TAG_DESCRIPTION'TITLE PRIMARY_SECTION $mt_category['categories_description']) . SECONDARY_SECTION WEB_SITE_KEYWORDS;
   
define('META_TAG_KEYWORDS'WEB_SITE_KEYWORDS $mt_category['categories_name']);
    }
    break; 
I have tried the following for stripping out the html

PHP Code:
$mt_categories_description substr(strip_tags(stripslashes($mt_categories_description['categories_description'])), 0100); 
and

PHP Code:
$mt_categories substr(strip_tags(stripslashes($mt_categories_description['categories_description'])), 0100); 
and
PHP Code:
$mt_categories_description TABLE_CATEGORIES_DESCRIPTION strip_tags($mt_categories_description); 
But none seem to work.

Can anybody help me with this last bit?
Pretty please?
With sugar on top?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 01-11-2008, 03:20 AM
New Member
 
Join Date: Nov 2007
Posts: 5
Thanks: 0
Thanked 4 Times in 2 Posts
Rep Power: 0
Interceptor is on a distinguished road
Default Re: Category description in meta tags?

Ok this is now sorted

Feel free to close the thread!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 01-12-2008, 12:20 PM
Lurker
 
Join Date: Nov 2007
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Power: 0
DreamOn2003 is on a distinguished road
Default Re: Category description in meta tags?

Could you please share your solution?
Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5  
Old 01-12-2008, 01:06 PM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 11,075
Thanks: 81
Thanked 348 Times in 327 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Default Re: Category description in meta tags?

We don't close threads unless they are over a year old.

I am sure there are others that would benefit from your work on this, so in the spirit of open source, how about sharing your solution? After all, I shared my work with you (osCMax!)
__________________
Michael Sasek
osCMax Developer


  • osCMax Templates - Hundreds of premium quality templates designed for osCMax 2. Loyalty discounts up to 30% off!
    Each purchase supports the osCMax project with much needed funds!

  • xShop for osCMax - Windows Based osCMax administration. Improved workflow, security, speed and convenience.

  • osCMax Hosting - From basic hosting to High Availability, Load Balanced arrays, the most experienced osCMax host. Default multi server configuration for exceptional performance!

  • osCMax Template Tutorial - Learn how to make your own custom templates and how to use the powerful features of the osCMax template system.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6  
Old 01-12-2008, 11:09 PM
New Member
 
Join Date: Nov 2007
Posts: 5
Thanks: 0
Thanked 4 Times in 2 Posts
Rep Power: 0
Interceptor is on a distinguished road
Default Re: Category description in meta tags?

I dont have a problem with sharing my work, but due to the lack of responses, and the fact this has never been asked before I assumed this was of no interest to anybody.

I'm no PHP expert, in fact more of a novice in every sense, but it was very easy to work out what needed doing by looking at the CONTENT_PRODUCT_INFO part of the meta_tag.php file.

Anyway, for those that do want good SEO, follow these instructions.

Open catalog/includes/meta_tags.php

Find

PHP Code:
case CONTENT_INDEX_PRODUCTS:
if (isset(
$HTTP_GET_VARS['manufacturers_id'])) {
$mt_manufacturer_query tep_db_query("select manufacturers_name from " TABLE_MANUFACTURERS " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
$mt_manufacturer tep_db_fetch_array($mt_manufacturer_query);
define('META_TAG_TITLE'$mt_manufacturer['manufacturers_name'] . PRIMARY_SECTION TITLE $web_site_tagline);
define('META_TAG_DESCRIPTION'TITLE PRIMARY_SECTION $mt_manufacturer['manufacturers_name']) . SECONDARY_SECTION WEB_SITE_KEYWORDS;
define('META_TAG_KEYWORDS'WEB_SITE_KEYWORDS $mt_manufacturer['manufacturers_name']);
} else {
$mt_category_query tep_db_query("select categories_name from " TABLE_CATEGORIES_DESCRIPTION " where categories_id = '" . (int)$current_category_id "' and language_id = '" . (int)$languages_id "'");
$mt_category tep_db_fetch_array($mt_category_query);
define('META_TAG_TITLE'$mt_category['categories_name'] . PRIMARY_SECTION TITLE $web_site_tagline);
define('META_TAG_DESCRIPTION'TITLE PRIMARY_SECTION $mt_category['categories_name']) . SECONDARY_SECTION WEB_SITE_KEYWORDS;
define('META_TAG_KEYWORDS'WEB_SITE_KEYWORDS $mt_category['categories_name']);
}
break; 
and replace with

PHP Code:
case CONTENT_INDEX_PRODUCTS:
if (isset(
$HTTP_GET_VARS['manufacturers_id'])) {
$mt_manufacturer_query tep_db_query("select manufacturers_name from " TABLE_MANUFACTURERS " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
$mt_manufacturer tep_db_fetch_array($mt_manufacturer_query);
define('META_TAG_TITLE'$mt_manufacturer['manufacturers_name'] . PRIMARY_SECTION TITLE $web_site_tagline);
define('META_TAG_DESCRIPTION'TITLE PRIMARY_SECTION $mt_manufacturer['manufacturers_name']) . SECONDARY_SECTION WEB_SITE_KEYWORDS;
define('META_TAG_KEYWORDS'WEB_SITE_KEYWORDS $mt_manufacturer['manufacturers_name']);
} else {
$mt_category_query tep_db_query ("select categories_name, categories_description, categories_heading_title from " TABLE_CATEGORIES_DESCRIPTION " where categories_id = '" . (int)$current_category_id "' and language_id = '" . (int)$languages_id "'");
$mt_category tep_db_fetch_array($mt_category_query);
$mt_categories_description substr(strip_tags(stripslashes($mt_category['categories_description'])), 0150);
define('META_TAG_TITLE'$mt_category['categories_name'] . PRIMARY_SECTION TITLE $web_site_tagline);
define('META_TAG_DESCRIPTION'PRIMARY_SECTION $mt_categories_description '...') . SECONDARY_SECTION WEB_SITE_KEYWORDS;
define('META_TAG_KEYWORDS'WEB_SITE_KEYWORDS);
}
break; 
If you want your category meta description longer or shorter change the value of 150 in the new code,to the number of characters you would like generated.

Last edited by Interceptor; 01-12-2008 at 11:32 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following 3 Users Say Thank You to Interceptor For This Useful Post:
Growler (10-24-2008), JohnW (05-17-2008), michael_s (01-14-2008)
  #7  
Old 01-14-2008, 07:20 PM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 11,075
Thanks: 81
Thanked 348 Times in 327 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Default Re: Category description in meta tags?

We have a ton of lurkers, so there is always interest even if nobody has an answer for you. Also, someone may come along weeks, months or years later, long after this thread is closed. Your post will help hundreds or thousands of osCMax users over the lifetime of the site. You should always share the solution, it is just the cool thing to do

Pretty cool that three years from now, somebody may read your post, and you help them solve their problem without even knowing it. That is the gift that keeps on giving!
__________________
Michael Sasek
osCMax Developer


  • osCMax Templates - Hundreds of premium quality templates designed for osCMax 2. Loyalty discounts up to 30% off!
    Each purchase supports the osCMax project with much needed funds!

  • xShop for osCMax - Windows Based osCMax administration. Improved workflow, security, speed and convenience.

  • osCMax Hosting - From basic hosting to High Availability, Load Balanced arrays, the most experienced osCMax host. Default multi server configuration for exceptional performance!

  • osCMax Template Tutorial - Learn how to make your own custom templates and how to use the powerful features of the osCMax template system.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8  
Old 07-13-2008, 05:31 PM
New Member
 
Join Date: May 2008
Posts: 14
Thanks: 2
Thanked 0 Times in 0 Posts
Rep Power: 0
Marotta1 is on a distinguished road
Thumbs up Re: Category description in meta tags?

Thank-you for posting this up as it saved me some time in locating and modifying the meta description tag for category pages. I changed it a little, but works out very nicely.

Quote:
We have a ton of lurkers, so there is always interest even if nobody has an answer for you. Also, someone may come along weeks, months or years later, long after this thread is closed. Your post will help hundreds or thousands of osCMax users over the lifetime of the site. You should always share the solution, it is just the cool thing to do

Pretty cool that three years from now, somebody may read your post, and you help them solve their problem without even knowing it. That is the gift that keeps on giving!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Advertisement
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Easy Meta Tags - CUSTOM Product Tags for STS v4 michael_s New osCommerce Contributions 0 11-26-2007 05:14 PM
Category Meta Tags michael_s New osCommerce Contributions 0 04-13-2007 12:00 PM
Category Meta Tags michael_s New osCommerce Contributions 0 03-18-2007 06:12 AM
meta tags, web site description advice? lil-raskals osCommerce 2.2 Modification Help 0 09-24-2004 11:35 AM
Meta Tags DiamondC osCommerce 2.2 Modification Help 2 01-20-2004 02:23 PM


All times are GMT -8. The time now is 12:54 AM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax