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 21 to 40 of 89
This thread is locked. New replies are disabled.
10 Jun 2006, 1:00 AM
#21
blessisaacola avatar

blessisaacola

Totally Zenned

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

mmmm...Meta Tags - help/guidance needed

Okay I am back but this time with a different issue:

What exactly is the line of code for in /include/module/meta_tags.php?```php
$meta_tags_over_ride = false;


What I am trying to do is override the html_header.php for the **index** page.

I created a folder in my custom template folder for index and modified html_header.php and placed it. Basically, the only thing I changed was the description tag for the main page.

When I navigated to the main page everything worked fine. However if I clicked on a category, the description tag that is displayed for the category is the one for the index not the custom description set on the admin side.

I have a reason to believe it might have something to do with the case statement for "index" in the meta_tags.php but I don't know what's going....

Help please! I really don't care how I get there...I just want a custom description tag for my home page.

Thanks!
10 Jun 2006, 1:23 AM
#22
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 is for when conditions exist where there cannot be a good build of the meta tag so it goes for a general meta tag ...

By not good, this would be EOF conditions ...

And it builds the meta tags based on:

// 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 . ' ' . (defined('NAVBAR_TITLE') ? NAVBAR_TITLE : ''));
}

If you do a search on: $meta_tags_over_ride

You can see where each of these situations can occure and nothing is found to build from, so this override kicks in so you have "something" valid ...

10 Jun 2006, 1:31 AM
#23
ajeh avatar

ajeh

Oba-san

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

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

Embarrassing moments confession ... :blush:

I am going through the upgrader and found ... gulp ... I sorta missed adding that configuration_key for: MAX_META_TAG_DESCRIPTION_LENGTH

in the upgrader ... :cry:

That insert will be added to the next release ... thanks so much for pursuing this and for posting your solution ...

How totally embarrassing can that be?! :oops:

10 Jun 2006, 1:40 AM
#24
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

Ajeh, there is nothing to be embarrased about...just means you're human :) Besides, considering how many people have upgraded and I was the only one pesting you about it....it must not have been that big of deal.

Is there a way to use the override system for the html_header.php for the index like I was trying without breaking it? The $100 question is which is more important...customer description for homepage or custom description for each category?

:)

10 Jun 2006, 1:47 AM
#25
ajeh avatar

ajeh

Oba-san

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

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

umm ... did you notice the cute little biohazard images now on the Categories?

Zen Cart v1.3 now has custom meta tags for Categories too ... :smile:

Make sure that you see the Orange biohazard, which indicates a custom meta tag is set for the Category/Product ... Black biohazard means it is not set ...

Do you have an URL to one of your Categories where you thought you had customized the meta tag for the Category?

Make sure that your meta_tags.php is dated:

 * @version $Id: meta_tags.php 3012 2006-02-11 16:34:02Z wilt $

Also make sure, if you are dated correctly, that you do not have an old meta_tags.php in your overrides directory ...

10 Jun 2006, 2:05 AM
#26
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

Ajeh, everything with the custom category works as it should. However, if I placed html_header.php in my includes/templates/custom/index folder to override just the index page it messes up just the description for the custom category meta_tags. It's very strange but that's the only problem I am experiencing when trying to have a custom description for the index page using the override system. Like I said in my previous post...I believe it has to do with all the case statement for "index" in the meta_tags file but I am not dangerous enough to mess with it.

I am enjoying the beauty of custom meta tags until I break with trying to get custom meta_tag description for the index page :(

10 Jun 2006, 3:57 AM
#27
ajeh avatar

ajeh

Oba-san

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

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

Can you define "messes up"?

I create /templates/my_template_dir/index

and copy the html_header.php into it ...

I get the same results in the meta tags on custom meta tags as I do if I do not have that there ...

Note: anything main_page=index

So, play the Classic game on this one too and see if there is something in your template ...

Make sure that your html_header.php override has all updates that are in the one for template_default ...

10 Jun 2006, 4:25 AM
#28
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

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

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

Oh ... and you won't need that index/html_header.php override anymore.

10 Jun 2006, 5:03 AM
#29
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

Thank You! Thank You!! Thank You!!! What a great day! I am soooooo glad for this solution! It works brilliantly. Can you tell I am excited....Whao! Zen Cart is cool!

Thanks Again!

10 Jun 2006, 5:14 AM
#30
ajeh avatar

ajeh

Oba-san

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

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

Maybe if you did a quick soft shoe or something across the screen ... :eek:

Tearing apart the meta tags to see what you might possibly want on there took a bit ... but DrByte types really fast when I throw a hundred and one facts at him on the what if game of guessing what could you possibly be after that isn't working the way it was designed ... other than a different design ... :rolleyes:

Glad the override of the override of the override works for you ... :cool:

10 Jun 2006, 5:34 AM
#31
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

I just sent some "coffee" your way via paypal. Thank you so much for the help on this. This should probably be posted in the FAQ section. In my opinion this completes the customization of meta_tags at product, category and homepage level.

Ah....I love Zen Cart! :thumbsup:

10 Jun 2006, 5:40 AM
#32
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

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

Glad to be of help. :lookaroun

4 Jul 2006, 3:16 AM
#33
corri avatar

corri

New Zenner

Join Date:
Jul 2006
Location:
Hawaii
Posts:
4
Plugin Contributions:
0

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

Hi everybody,
I have a question about meta tag set up. I received an email from the ranking service company with some stuff I needed to paste and it looks like meta tags. Do I have to paste them the the HTML codes that they sent them with? I am so new at this, any advice would be greatly appreciated. :blush: Thank you!

4 Jul 2006, 4:20 AM
#34
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

Corri:

Hi everybody,
I have a question about meta tag set up. I received an email from the ranking service company with some stuff I needed to paste and it looks like meta tags. Do I have to paste them the the HTML codes that they sent them with? I am so new at this, any advice would be greatly appreciated. :blush: Thank you!

It would help if you elaborate more what type of information you received. Is it a tracking code? Optimized keywords? Optimized description? Depending on what you receive, that will determine what's the proper and efficient place to place the code.

4 Jul 2006, 4:38 AM
#35
corri avatar

corri

New Zenner

Join Date:
Jul 2006
Location:
Hawaii
Posts:
4
Plugin Contributions:
0

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

This is the line the email opens with:

Your website code has now been thoroughly analyzed and optimized to a standard that we believe will place you in a whole variety of top 10 ranking positions across most of the major search engines that were included within your original promotion package (and any associated upgrade solutions purchased).

THANK YOU FOR YOUR HELP!! :D

4 Jul 2006, 5:19 AM
#36
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

Corri:

This is the line the email opens with:

Your website code has now been thoroughly analyzed and optimized to a standard that we believe will place you in a whole variety of top 10 ranking positions across most of the major search engines that were included within your original promotion package (and any associated upgrade solutions purchased).

THANK YOU FOR YOUR HELP!! :D

It would appear you're dealing with meta tags.... Just a quick lesson.

Zen Cart is built with a feature to have separate meta tag for each category and products that are separate from the ones on general pages.

to define meta tags for category, go to the Admin -> Catalog -> Categories/Products once you're there..click on the meta tag icon (the last one to the right for any given category) and edit away.

If you want to define meta tag for each product, you will navigate to that product and click on the meta tag icon to define it.

To define site-wide keywords, go to includes/languages/english/YOURcustomtemplatefolder/metatags.php and edit that file for keywords, site title, site tagline and site description.

There more options like using a custom description for the indexed page, changing the amount of text used for default description for products when meta tags are not presents. I have just given you a quick snapshot based on the limited information you provided. You can PM is you need more help but do not want to reveal the information from your ranking company in the public :)

BTW, whatever information you're trying to put on your site will become public to the whole world once you do it right :)

4 Jul 2006, 5:24 AM
#37
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

By the way, you might want to reconsider your direct violation eBay terms of service on your eBay store landing page. eBay will eventually freeze your account when then find out but you're not in serious danger as you're not a PowerSeller. eBay usually pay more attention to PowerSellers violating TOS rather than regular sellers.

6 Jul 2006, 4:30 AM
#38
corri avatar

corri

New Zenner

Join Date:
Jul 2006
Location:
Hawaii
Posts:
4
Plugin Contributions:
0

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

Ok, thank you soo much. I appreciate all of your help. Aloha! :smile:

6 Jul 2006, 11:38 AM
#39
photogold avatar

photogold

New Zenner

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

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

I need some help with editing the meta tag description on my home page . It includes the category names and it is far too long . An optimum meta tag description should only be up to 8 words . Which file do I need to edit and what do I need to do to get rid of the category names ?

6 Jul 2006, 2:04 PM
#40
ajeh avatar

ajeh

Oba-san

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

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

Meta Tags are controlled in the /includes/modules/meta_tags.php

You can customize this to suite your needs ...

Look at the case statements as they are triggered by the various pages and can be customized to suit ...