Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

cDynamic Meta Tags


clarocque

Recommended Posts

  • Replies 384
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 weeks later...

I've got the cDynamic Meta Tags working on the pages included in includes/meta_tags.php. (such as specials.php, products_new.php, product_info.php, etc.)

 

However, I've added a couple other pages to my site that I'd like cDynamic to work with such as all_products.php (which lists categories/product titles). How do I go about getting it to work with these new pages. Do I need to add it somehow to includes/meta_tags.php? I'm just not sure how to go about doing this. Thanks for any help.

 

p.s. I'm using STS.

Link to comment
Share on other sites

I've got the cDynamic Meta Tags working on the pages included in includes/meta_tags.php. (such as specials.php, products_new.php, product_info.php, etc.)

 

However, I've added a couple other pages to my site that I'd like cDynamic to work with such as all_products.php (which lists categories/product titles).  How do I go about getting it to work with these new pages.  Do I need to add it somehow to includes/meta_tags.php?  I'm just not sure how to go about doing this.  Thanks for any help.

 

p.s. I'm using STS.

 

 

To add additional pages add them to this line :

 

$heading_pages = array('contact_us.php', 'product_reviews.php');

 

around line 60 in includes/;anguages/english.php

osC Contributions I have published.

 

Note: Some I only provided minor changes, updates or additions!

Link to comment
Share on other sites

Hi,

 

I have installed cDynamic_Meta_Tags v1.4.

 

When testing it I get the title back but no keywoards are generated.

 

How do I include keywords?

 

And, do I have to modify the default;

 

#---------------------------------------------------------------------------#

# Define specific meta tags by entering the value between the '':

 

# For all pages using meta_tags:

define('HEAD_TITLE_TAG_ALL',''); # Title

define('HEAD_DESC_TAG_ALL',''); # Description

define('HEAD_KEY_TAG_ALL',''); # Keywords

 

# For default index page (no products or categories)

define('HEAD_TITLE_TAG_INDEX',''); # Title

define('HEAD_DESC_TAG_INDEX',''); # Description

define('HEAD_KEY_TAG_INDEX',''); # Keywords

 

Regards Peter

 

If you ar not seeing keywords or description on products and/pr actegories something is wrong...

 

 

If you are talking about say the index.php page (home page) you will have to set the defaults in the fields you listed above....

osC Contributions I have published.

 

Note: Some I only provided minor changes, updates or additions!

Link to comment
Share on other sites

To add additional pages add them to this line :

 

$heading_pages = array('contact_us.php', 'product_reviews.php');

 

around line 60 in includes/;anguages/english.php

 

you mean english/meta_tags.php right? not english.php?

 

All this will do is put the HEADING_TITLE in the <title></title> right?

 

but for my all_products.php page I want it to generate keywords/descriptions like it does for the product_info.php, specials.php, etc.

Link to comment
Share on other sites

you mean english/meta_tags.php right? not english.php?

 

All this will do is put the HEADING_TITLE in the <title></title> right?

 

but for my all_products.php page I want it to generate keywords/descriptions like it does for the product_info.php, specials.php, etc.

 

yes sorry - not english.php

 

 

If you want that for all products you will have to right the logic for the page sepcificily

osC Contributions I have published.

 

Note: Some I only provided minor changes, updates or additions!

Link to comment
Share on other sites

  • 1 month later...

I am sure people will think this is a dumb question

 

I have just installed this contrib and all I have remaining to do is

STEP 3 - Edit pages you want to use meta tags on (like index.php, product_info.php etc)

 

Replace

 

<title><?php echo TITLE; ?></title>

 

with

 

<?php

# cDynamic Meta Tags

/*<title><?php echo TITLE; ?>*/

require(DIR_WS_INCLUDES . 'meta_tags.php');

#

?>

I can not find the files to edit and the code <title><?php echo TITLE; ?></title>

 

Could some one just point me in the right direction please .

Link to comment
Share on other sites

Warning: Cannot modify header information - headers already sent by (output started at /home/ronnie/public_html/includes/languages/english.php:697) in /home/ronnie/public_html/includes/functions/general.php on line 29

 

 

Getting this error eveen thou I have tried to restore how it was

 

HELP

Link to comment
Share on other sites

Has anyone considered modifying this contribution specically for use wink Link Manager and and Article Manager? I tried myself, but I must admit my shortcomings. Other than that one small thing I'm more than satisfied with this contribution.

 

 

What type o fmeta tags do you want for links manager????

osC Contributions I have published.

 

Note: Some I only provided minor changes, updates or additions!

Link to comment
Share on other sites

I recently installed cDynamic Meta Tags V 1.3a and thought all was well.

 

Install was easy, instructions precise and to the point.

 

After installing it I opened the source code up via IE view-->source and Firefox view -->page source

 

everything is appearing how it should... I was in a happy place.. :)

 

 

Till I ran a program called "Dynamic Web Ranking" and used the Web Site Optimizer feature...

 

It goes through and give you recommendations on how to improve your keywords and such...

 

To my dismay, it does not list any keywords or descriptions..... might this also be what happens with certain search engines... Can someone put my mind at east and tell me this contrib does report correctly to most search engines?

Link to comment
Share on other sites

Thank you Clarocque for this contribution. I installed Version 1.3a today and it works great!

 

I just thought that I should point out that in Step 1 of the instructions, the 4th item - reads:

 

includes/functions/meta_tags.php should be uploaded to your *catalog*/includes/ directory

 

 

but should read:

 

includes/functions/meta.php should be uploaded to your *catalog*/includes/functions directory

 

 

I'm sure that most people install it properly based on the directory structure in the download but I missed this and put meta.php directly in my /includes directory and not the /includes/functions directory and had a blank page with an error when I clicked on the product page.

 

Regards,

Sydney

Link to comment
Share on other sites

  • 2 weeks later...

I agree - great contribution. I started installing header controller til I got to the massive cut and paste section and decided I had enough. I wish I had found this first.

 

Everything works great but I'm having a small problem and I haven't found it in the support thread. When I go the product_review page I get the HEADING_TITLE - literally. It puts HEADING_TITLE - Store Name in the title bar.

 

I've been trying to learn some PHP as I go along and I'm wondering if the problem is here: includes/meta_tags.php

 

# other pages
}else{
# Title
# pages to use HEADING_TITLE loop
foreach ($heading_pages as $index => $page){
if (strpos($_SERVER['PHP_SELF'], $page) ){
$metatitle=HEADING_TITLE.' - ';}}

 

does this imply a problem with the php version? It's 4.4

 

Thanks for any help

Dan

Link to comment
Share on other sites

Ok - that was kind of obvious. There isn't a HEADING_TITLE for product_reviews.php defined. I can see why this is a default exception page.

 

Is there a way to use the products title? Would it help for indexing?

 

Thanks for the great contribution,

 

Dan

Link to comment
Share on other sites

Can someone tell me where to find the code below. My shop items pages title tags work but I used to have an echo of my shop name after the products name, now I dont. I would like to figure out how get this working again. Thanks

 

$metatitle.=$title .' '.STORE_NAME;

 

 

 

 

 

 

 

 

 

 

Mike,

 

There could be many reasons that it might be slower...

 

Server

myql

php version etc.

 

It is running queries to get the dat so there is more work to load a pgae and if you have have alot of products and cats it will take long.

 

How many do you have?

 

That is why I built in a cache option to it so there was not the added queries on page load.

 

Look around line 127 for :

$metatitle.=$title .' '.STORE_NAME;

 

that is where the store name is loading for the product_info pages.

 

you can comment that line.

 

Chris

 

How many Prods and Cats do you have?

 

What are your server specs?

Link to comment
Share on other sites

Hi, I have a couple of questions.

 

I have a category description. I thought I downloaded a version before this was removed but it is using the default meta page description. Could someone point me to a version that will utilize my category description, or the changes for the meta_tags file.

 

Also I've added a few extra fields to my product descriptions. Can I simply querry for this data and place more values in $product_meta_info ?

# get data for the description
$desc.=$product_meta_info['products_name'];
$man=$product_man_meta_info['manufacturers_name'];
$descfull.=$product_meta_info['products_description'];

 

Thanks for any help,

Dan

Link to comment
Share on other sites

Hi, I have a couple of questions.

 

I have a category description. I thought I downloaded a version before this was removed but it is using the default meta page description. Could someone point me to a version that will utilize my category description, or the changes for the meta_tags file.

 

Also I've added a few extra fields to my product descriptions. Can I simply querry for this data and place more values in $product_meta_info ?

# get data for the description
$desc.=$product_meta_info['products_name'];
$man=$product_man_meta_info['manufacturers_name'];
$descfull.=$product_meta_info['products_description'];

 

Thanks for any help,

Dan

 

Dan if you cant find an early version on osc this will have the code you need - you can pick through it

 

# index.php with categories
}else if (strpos($_SERVER['PHP_SELF'], 'index.php') || strpos($_SERVER['PHP_SELF'], 'window.php')){

# If using Categories & Products get the product info
if ($current_category_id && CAT_PRODUCTS =='true'){
$cacherun='true';
$categories_query = tep_db_query("select categories_name, categories_description from " . TABLE_CATEGORIES_DESCRIPTION . " WHERE  categories_id ='"  .$current_category_id. "' 
AND language_id = '" . (int)$languages_id . "'");
$categories = tep_db_fetch_array($categories_query);

# get sub categories to list keywords when no product
$sub_categories_query = tep_db_query("select cd.categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_CATEGORIES  . " c   WHERE c.parent_id ='"  .$current_category_id. "' AND c.categories_status = '1' AND cd.categories_id = c.categories_id AND cd.language_id = '" . (int)$languages_id . "' LIMIT 20");

# get top level categories to list keywords when no product or sub cats
if ($category_depth != 'products' && $category_depth != 'nested') {
$categories_all_query = tep_db_query("select cd.categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_CATEGORIES  . " c   WHERE c.parent_id = 0 AND c.categories_status = '1' AND cd.categories_id = c.categories_id AND cd.language_id = '" . (int)$languages_id . "' ORDER BY c.sort_order ASC");
}

# Start getting data for the meta tags
$title.=$categories['categories_name'];

$pre_desc=strip_tags($breadcrumb->trail(' - ')); 
$pre_desc=str_replace('"', '?', $pre_desc);
$desc.=$pre_desc.' from '.STORE_NAME.'.';

if (tep_not_null($categories['categories_description'])) {
$fa = array('’', '"','&','"');
$ra = array('\'', '"','&','?');
$desc.=' '.str_replace($fa, $ra, $categories['categories_description']);
}

tep_not_null(HEAD_DESC_TAG_ALL)
 ? $desc.=HEAD_DESC_TAG_ALL
 : NULL;

$metadescription=meta_create_meta_description($metadescription);

$key.=$categories['categories_name'].', ';

# get sub categories to list as keywords when no product
if ($category_depth != 'products') {
while ($sub_categories = tep_db_fetch_array($sub_categories_query)) {
$key.=$sub_categories['categories_name'].', ';
}
}

# get the products in this category
if ($category_depth == 'products') {
$products_query = tep_db_query("SELECT pd.products_name FROM " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " .  TABLE_PRODUCTS_TO_CATEGORIES . " pc WHERE pc.categories_id = '".$current_category_id."' AND pc.products_id = p.products_id AND p.products_status = '1' AND p.products_id = pd.products_id AND pd.language_id = '" . (int)$languages_id . "' ORDER BY rand()");
while($products = tep_db_fetch_array($products_query)) {
$key.=$products['products_name'].', ';
}
}

if ($category_depth != 'products' && $category_depth != 'nested') {
while ($categories_all = tep_db_fetch_array($categories_all_query)) {
$key.=str_replace($categories['categories_name'], '`~`~`',$categories_all['categories_name']).', ';
}
}

# if the page is showing products by manufacturers
}else if ($HTTP_GET_VARS['manufacturers_id']){
$title.=$manufacturers['manufacturers_name'];
$desc.='Products by '.$manufacturers['manufacturers_name'].' from '.STORE_OWNER;

// get products by this manufacturer
$listing_man_sql = tep_db_query("select pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' AND p.products_status = '1' AND pd.products_id = p.products_id ORDER BY rand()");
while($products = tep_db_fetch_array($listing_man_sql)) {
$key.=$products['products_name'].', ';
}
}

# index.php default
if (!isset($HTTP_GET_VARS['manufacturers_id']) && (!$current_category_id)) $default=true;

# Final stage for index.php w/o categories
# Title
tep_not_null($title)
 ? $metatitle.=$title.' - '
 : NULL;

$metatitle.=STORE_NAME;
tep_not_null(HEAD_TITLE_TAG_ALL) && $default==true
 ? $metatitle.=HEAD_TITLE_TAG_ALL
 : NULL;

tep_not_null(HEAD_TITLE_TAG_INDEX)
 ? $metatitle.=HEAD_TITLE_TAG_INDEX
 : NULL;

$metatitle=meta_create_title($metatitle);

# Description
!tep_not_null($desc)
 ? $metadescription.=STORE_NAME.' - '
 : NULL;

tep_not_null(HEAD_DESC_TAG_ALL) && $default==true
 ? $desc.=HEAD_DESC_TAG_ALL
 : NULL;

$metadescription.=$desc;

tep_not_null($metadescription)&& $default==true
 ? $metadescription.=' - '
 : NULL;

tep_not_null(HEAD_DESC_TAG_INDEX) && $default==true
 ? $metadescription.=HEAD_DESC_TAG_INDEX
 : NULL;

$metadescription=meta_create_meta_description($metadescription);

# Keywords
tep_not_null(HEAD_KEY_TAG_INDEX) && $default==true
 ? $key.=HEAD_KEY_TAG_INDEX.', '
 : NULL;

tep_not_null(HEAD_KEY_TAG_ALL)
 ? $key.=HEAD_KEY_TAG_ALL
 : NULL;

$metakeywords=strtolower(meta_create_meta_keywords($key));

Edited by clarocque

osC Contributions I have published.

 

Note: Some I only provided minor changes, updates or additions!

Link to comment
Share on other sites

  • 2 weeks later...

Hello!

 

I'm sorry if this is a dumb question, but I've spent all day searching these forums, attempting to utilize other's advice, and downright asking for help (see http://www.oscommerce.com/forums/index.php?showtopic=184865 ).

 

I'm using a cart that has already been pre-modified with this contribution by the hosting company. Out of the box it appears to work fine, but today while trying to apply an STS template I kept getting this error:

 

Fatal error: Cannot redeclare meta_create_title() (previously declared in /home/xxxx/public_html/includes/functions/meta.php:30) in /home/xxxx/public_html/includes/functions/meta.php on line 30

 

If I take all the code out of meta.php and leave just the comments, the site works fine and the template is in perfect place....but of course this defeats the entire purpose of this contribution :(

 

Any suggestions??

 

 

Fullasoul

Link to comment
Share on other sites

Hello!

 

I'm sorry if this is a dumb question, but I've spent all day searching these forums, attempting to utilize other's advice, and downright asking for help (see http://www.oscommerce.com/forums/index.php?showtopic=184865 ).

 

I'm using a cart that has already been pre-modified with this contribution by the hosting company. Out of the box it appears to work fine, but today while trying to apply an STS template I kept getting this error:

 

Fatal error: Cannot redeclare meta_create_title() (previously declared in /home/xxxx/public_html/includes/functions/meta.php:30) in /home/xxxx/public_html/includes/functions/meta.php on line 30

 

If I take all the code out of meta.php and leave just the comments, the site works fine and the template is in perfect place....but of course this defeats the entire purpose of this contribution :(

 

Any suggestions??

Fullasoul

 

 

 

Is there some other forum I should be asking for help at? Before making the leap into trying to build my cart, everyone went on and on about how supportive the oscommerce community is...and yet for 4 days I've been essentially talking to myself here....not one remote attempt at help from anyone here or on my other thread :(

 

 

Fullasoul

Link to comment
Share on other sites

Is there some other forum I should be asking for help at? Before making the leap into trying to build my cart, everyone went on and on about how supportive the oscommerce community is...and yet for 4 days I've been essentially talking to myself here....not one remote attempt at help from anyone here or on my other thread :(

Fullasoul

 

 

SAorry I cant off you to much help via forum as I dont use STS in fact I avoid it for different reasons. A quick fix would be to rename one of the functionss if they are not the same.

osC Contributions I have published.

 

Note: Some I only provided minor changes, updates or additions!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...