Re: 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 Code:
$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!
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:
PHP Code:
// 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 ...
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:
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?
:)
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:
PHP Code:
* @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 ...
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 :(
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 ...
Re: mmmm...Meta Tags - help/guidance needed
In your YOURTEMPLATE/custom/html_header.php, change this line:
HTML Code:
<meta name="description" content="<?php echo META_TAG_DESCRIPTION; ?>" />
to this:
PHP Code:
<?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.
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!
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: