Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / mmmm...Meta Tags - help/guidance needed

mmmm...Meta Tags - help/guidance needed

Locked

Views: 29,855

Results 41 to 60 of 89
This thread is locked. New replies are disabled.
6 Jul 2006, 2:18 PM
#41
photogold avatar

photogold

New Zenner

Join Date:
Jan 2006
Posts:
27
Plugin Contributions:
0

mmmm...Meta Tags - help/guidance needed

You'll have to excuse my ignorance but I am not that familiar with PHP . What are case statements ? what statement do I need to remove or edit to get rid of the category names in the meta description tag ? Thanks for your help

6 Jul 2006, 2:25 PM
#42
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: mmmm...Meta Tags - help/guidance needed

This starts the selection of code to build the keywords to include the category names ...

// 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'] . ' ';
  $keywords_metatags->MoveNext();
}
define('KEYWORDS', str_replace('"','',zen_clean_html($keywords_string_metatags) . CUSTOM_KEYWORDS));

If you never want to see a single category name in your meta tags you would change this section of code so that KEYWORDS never has anything in it when it starts to look at the case statements below to add on to that define ...

6 Jul 2006, 2:38 PM
#43
designbydemeter avatar

designbydemeter

Zen Follower

Join Date:
Jun 2006
Location:
Taos,NM
Posts:
225
Plugin Contributions:
0

Re: mmmm...Meta Tags - help/guidance needed

Been reading this thread and others and I'm a bit confused. I understand in the previous post how to stop generating those weird keywords. However, I'm still confused about inserting predefined keywords and description for my main page. I have modified my custom template files but they do not appear to be populating.

It would be so cool in the next version to have a way to do this from Admin without having to futz with code.

6 Jul 2006, 2:55 PM
#44
photogold avatar

photogold

New Zenner

Join Date:
Jan 2006
Posts:
27
Plugin Contributions:
0

Re: mmmm...Meta Tags - help/guidance needed

I tried removing some of the code but I got this message -
Warning: Missing argument 1 for zen_clean_html() in /home/322/first121/www.castlepictures.com/public_html/includes/functions/functions_general.php on line 1216

what code should I remove exactly ?

6 Jul 2006, 3:04 PM
#45
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: mmmm...Meta Tags - help/guidance needed

Change this:

// 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'] . ' ';
  $keywords_metatags->MoveNext();
}
define('KEYWORDS', str_replace('"','',zen_clean_html($keywords_string_metatags) . CUSTOM_KEYWORDS));

To read:

/*
// 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'] . ' ';
  $keywords_metatags->MoveNext();
}
define('KEYWORDS', str_replace('"','',zen_clean_html($keywords_string_metatags) . CUSTOM_KEYWORDS));
*/
define('KEYWORDS','');

This will start the KEYWORDS to have no value ...

You will then need to check your pages to see what the results will be in order to customize them further ...

6 Jul 2006, 3:39 PM
#46
photogold avatar

photogold

New Zenner

Join Date:
Jan 2006
Posts:
27
Plugin Contributions:
0

Re: mmmm...Meta Tags - help/guidance needed

Your suggested code works perfectly . Thanks for helping me on this . It might be a good idea to add a feature in the next version of Zencart to allow websites to edit the meta tag description from the Admin area . It's quite a crucial meta tag - I've heard that it is the only one that search engines actually index .

6 Jul 2006, 3:52 PM
#47
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: mmmm...Meta Tags - help/guidance needed

Search engines will index all of your pages ...

Build your pages to have proper text, meaning significant text, to increase their content value for search engines ...

While meta tags are helpful, they are not the end all and be all ...

The content is more significant ... the content relative to the meta tags is significant ...

Notice the custom meta tags for each Category and Product ...

Notice the categories_description and products_description ... these are highly important ...

Lack of content is the major issue ...

I have customers with 79,000 pages in Google ... the search engines do like more than the index ... :)

9 Sep 2006, 3:47 PM
#48
baschwar avatar

baschwar

New Zenner

Join Date:
Apr 2006
Posts:
44
Plugin Contributions:
0

Re: mmmm...Meta Tags - help/guidance needed

I would like to know how to limit the # of meta keywords and descriptions used on the home page and other pages. The posts above didn't really clarify that for me.

I looke for MAX_META_TAG_DESCRIPTION_LENGTH but I dont' see anywhere in the admin, etc. to input a value.

Thanks,

Brad

22 Sep 2006, 5:12 AM
#49
anjordan77 avatar

anjordan77

Zen Follower

Join Date:
Jun 2006
Location:
Midlothian, Virginia, United States
Posts:
110
Plugin Contributions:
0

Re: mmmm...Meta Tags - help/guidance needed

How would i make it use the main Title for the index page but then after use the meta tag title i so pain stakingly entered for each of my 500 products.

The Meta Description and Meta Keywords are working good for every product.

Zen Cart 1.3.0

http://www.allpaintballsupplies.com

I'm trying to get my title to change when you are in looking at the actual product like this website does:
http://www.firstcallpaintball.com/pages-productinfo/category-99_108_110/product-3569/paintball-guns-smart-parts-ion-smart-parts-virtue-ion.html?zenid=d4fd98b3d194818ecb3537ec90adab2d

notice how their title changes when they go to different product pages. how do i set that up?

22 Sep 2006, 12:13 PM
#50
tlc avatar

tlc

New Zenner

Join Date:
Dec 2005
Posts:
53
Plugin Contributions:
0

Re: mmmm...Meta Tags - help/guidance needed

What would make almost all of my meta tags disappear?

I didn't notice this until this morning but I am going to have to create meta tags for almost all of my 745 products/catagories again!

I recently did the 1.3.5 upgrade. Also had installed the GoogleFroogle mod, then had problems with that changing all my prices to '0', so I deleted the GoogleFroogle mod.

I think the meta tags had to have disappeared BEFORE the GoogleFroogle thing because I ended up having to use my database backup to restore my web site and I just noticed that most of the catagories and all of the products meta tags are gone. :bangin: They could have been missing for awhile, but what would cause this?

22 Sep 2006, 4:09 PM
#51
anjordan77 avatar

anjordan77

Zen Follower

Join Date:
Jun 2006
Location:
Midlothian, Virginia, United States
Posts:
110
Plugin Contributions:
0

Re: mmmm...Meta Tags - help/guidance needed

v1.3.0
To get it to use your Meta Titles when it's anywhere but your Index Page this seemed to work for me. This will use what you specify on the index page if you change where i have

All Paintball Supplies - Paintball Guns, Marker, Clothes, Barrels, Paintballs, Paintball Gear, Paintball Hoppers - All Paintball Supplies

and also use your meta title for each individual category and product. To change yours alter the following:

public_html/includes/templates/YOURTEMPLATEHERE/common/html_header.php

I edited everything between the <title> </title>

<title><?php $slashpos = strrpos($_SERVER['REQUEST_URI'],"/"); if ($slashpos === false || $slashpos == strlen($_SERVER['REQUEST_URI'])) { $thispage = $_SERVER['REQUEST_URI']; } else { $thispage = substr($_SERVER['REQUEST_URI'],$slashpos+1,strlen($_SERVER['REQUEST_URI'])-1); } if ($thispage == "index.php" || $thispage == "index.php?main_page=index" || $thispage == "") { echo 'All Paintball Supplies - Paintball Guns, Marker, Clothes, Barrels, Paintballs, Paintball Gear, Paintball Hoppers - All Paintball Supplies'; } else { echo '' . META_TAG_TITLE . '' ; } ?> </title>
19 Jun 2007, 6:11 PM
#52
vandiermen avatar

vandiermen

Totally Zenned

Join Date:
Feb 2007
Posts:
518
Plugin Contributions:
1

Re: mmmm...Meta Tags - help/guidance needed

anjordan77:

v1.3.0
To get it to use your Meta Titles when it's anywhere but your Index Page this seemed to work for me. This will use what you specify on the index page if you change where i have

All Paintball Supplies - Paintball Guns, Marker, Clothes, Barrels, Paintballs, Paintball Gear, Paintball Hoppers - All Paintball Supplies

THANKS!!!!:clap:

I even used this method on my <meta name="description" content="<?php

If anyone does not quite get what to do at first: Repale <title><?php echo META_TAG_TITLE; ?></title> with the code anjordan77 has given you above

21 Jun 2007, 3:34 AM
#53
studeo avatar

studeo

Zen Follower

Join Date:
Jan 2007
Posts:
198
Plugin Contributions:
0

Re: mmmm...Meta Tags - help/guidance needed

So I have entered meta tags for each category and product. When I view the source of a product or category page, the meta title is my new assigned title for that specific page, but the description defaults to the same overall site description...NOT THE PRODUCT DESCRIPTION! Same with the custom keywords I have defined for each product and category....what am I doing wrong???

studeo

29 Jan 2008, 11:06 PM
#54
rlexyd avatar

rlexyd

Zen Follower

Join Date:
Nov 2006
Location:
Sydney, Australia
Posts:
473
Plugin Contributions:
0

Re: mmmm...Meta Tags - help/guidance needed

DrByte:

In your YOURTEMPLATE/custom/html_header.php, change this line:```html
<meta name="description" content="<?php echo META_TAG_DESCRIPTION; ?>" />

>  
> to this:
> ```php
<?php if ($current_page!='index' || (int)$cPath>0 ) { ?>
<meta name="description" content="<?php echo META_TAG_DESCRIPTION; ?>" />
<?php } else { ?>
<meta name="description" content="<?php echo CUSTOM_HOMEPAGE_META_TAG_DESCRIPTION; ?>" />
<?php } ?>

This says:

  • if (I'm not on the homepage), then display normal metatags content
  • else if(I"m on the homepage), then display the custom metatags content via the CUSTOM_HOMEPAGE_META_TAG_DESCRIPTION constant which you'd have to set in your languages/english/meta_tags.php.

Hi DrByte, how have you been?

Just have a questions for you...

I as well want Zen Cart to keep generating all the meta tags for everything..all is well with that...!! The only thing I want to do myself is ADD a Specific Description to my HOME page only!!

I added the above to the HTML_ Header.php, but now my description comes up as (CUSTOM_HOMEPAGE_META_TAG_DESCRIPTION)...

In my Meta_Tags.php file, I only have the define ('Site_tagline) and the define ('custom_keywords)....there is no description in there??

What do I do now??

Thanking you in advance :)

29 Jan 2008, 11:27 PM
#55
blessisaacola avatar

blessisaacola

Totally Zenned

Join Date:
Feb 2004
Location:
Georgia, USA
Posts:
1,875
Plugin Contributions:
1

Re: mmmm...Meta Tags - help/guidance needed

If you're using ZCV1.3.8a you no longer need the code provided by DrByte as the new version of ZC supports customer metatag for home page.

30 Jan 2008, 4:05 AM
#56
rlexyd avatar

rlexyd

Zen Follower

Join Date:
Nov 2006
Location:
Sydney, Australia
Posts:
473
Plugin Contributions:
0

Re: mmmm...Meta Tags - help/guidance needed

Thanks for that BlessIsaacola...

I have too many things going on right now and updating from 1.3.7 to 1.3.8 is not gona happen for now..
What can I do for now for the current 1.3.7 that I am using please?

Thanking you in advance :smile:

30 Jan 2008, 4:17 AM
#57
blessisaacola avatar

blessisaacola

Totally Zenned

Join Date:
Feb 2004
Location:
Georgia, USA
Posts:
1,875
Plugin Contributions:
1

Re: mmmm...Meta Tags - help/guidance needed

rlexyd:

Thanks for that BlessIsaacola...

I have too many things going on right now and updating from 1.3.7 to 1.3.8 is not gona happen for now..
What can I do for now for the current 1.3.7 that I am using please?

Thanking you in advance :smile:

Did you complete this part: CUSTOM_HOMEPAGE_META_TAG_DESCRIPTION constant which you'd have to set in your languages/english/meta_tags.php.?

Remember you need to make changes in two files, it sounds like you only changed the html_header.php but not languages/english/meta_tags.php. If you have a custom template, make sure you use override for the two files as well.

30 Jan 2008, 7:56 AM
#58
rlexyd avatar

rlexyd

Zen Follower

Join Date:
Nov 2006
Location:
Sydney, Australia
Posts:
473
Plugin Contributions:
0

Re: mmmm...Meta Tags - help/guidance needed

Thank you again,
your help is much appreciated :)

That is what I mean, I don't what to do for the second part?
I thought there would have been a description tag to change or something...not quite sure of what I need to do in the second file!

Thank you

30 Jan 2008, 8:01 AM
#59
blessisaacola avatar

blessisaacola

Totally Zenned

Join Date:
Feb 2004
Location:
Georgia, USA
Posts:
1,875
Plugin Contributions:
1

Re: mmmm...Meta Tags - help/guidance needed

rlexyd:

Thank you again,
your help is much appreciated :)

That is what I mean, I don't what to do for the second part?
I thought there would have been a description tag to change or something...not quite sure of what I need to do in the second file!

Thank you

Add this:```php
// Index Description
define('CUSTOM_HOMEPAGE_META_TAG_DESCRIPTION', 'your custom description goes in here');


Again, this is only needed if using 1.3.7.1 or earlier.
30 Jan 2008, 9:46 AM
#60
rlexyd avatar

rlexyd

Zen Follower

Join Date:
Nov 2006
Location:
Sydney, Australia
Posts:
473
Plugin Contributions:
0

Re: mmmm...Meta Tags - help/guidance needed

Thank you.

I added that code to my Meta_Tags.php in my own template, and the description is still the same as the keywords on the front page.
It did not pick up the new description which I added into the code you just gave me?

Is there anything I can do?