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?
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 ...
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?
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
I have tried the following for stripping out the htmlPHP 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;
andPHP Code:$mt_categories_description = substr(strip_tags(stripslashes($mt_categories_description['categories_description'])), 0, 100);
andPHP Code:$mt_categories = substr(strip_tags(stripslashes($mt_categories_description['categories_description'])), 0, 100);
But none seem to work.PHP Code:$mt_categories_description = TABLE_CATEGORIES_DESCRIPTION . strip_tags($mt_categories_description);
Can anybody help me with this last bit?
Pretty please?
With sugar on top?
Ok this is now sorted
Feel free to close the thread!
Could you please share your solution?
Thanks![]()
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 installation service - Have our professionals install osCmax on your server - same day service!
osCmax 2.0 User Manual - the must have beginners guide to osCmax v2.0
Stay Up To Date with everything osCMax:
Free osCMax Newsletters - Security notices, New Releases, osCMax News
osCMax on Twitter - Up to the minute info as it happens. Know it first.
osCmax Documentation
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
and replace withPHP 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;
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.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'])), 0, 150);
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;
Last edited by Interceptor; 01-12-2008 at 11:32 PM.
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 installation service - Have our professionals install osCmax on your server - same day service!
osCmax 2.0 User Manual - the must have beginners guide to osCmax v2.0
Stay Up To Date with everything osCMax:
Free osCMax Newsletters - Security notices, New Releases, osCMax News
osCMax on Twitter - Up to the minute info as it happens. Know it first.
osCmax Documentation
Bookmarks