Latest News: (loading..)
Jack_mcs

Header Tags SEO

8,312 posts in this topic

This is the support thread for the new Header Tags SEO contribution. It is based on the Header Tags Controller but is not compatible.

 

Why the new name?

There are a couple of reasons for this. First, so much has changed in the code that it is mostly a different package and maintaining it would be difficult if it were considered just an update. But beyond that, a lot of people mistakenly confuse the Header Tags Controller as just a meta tags handler. It is that but has gone beyond that basic function for some time now. So to compare it to the other meta tags contributions is just wrong. And I should say here that if all you are looking for is a way to handle the meta tags of your shop, you should not install this contribution since it is definitely overkill. But when you consider that the keywords meta tag is rarely used by google at all nowadays, I can't imagine why someone would want to install a package that relied on that tag so much. And that is the real reason for the new name. This contribution is the only one of its kind to tie together so many Search Engine Optimization (SEO) tricks, that the new namejust made sense.

 

What's the difference?

The following are the major changes (or the ones I could remember) in this new

contribution:

 

-> The code is 100% langage compliant.

-> Removed the english/header_tags.php file in favor of database entries.

-> Fixed a bug introduced in a previous version. A spelling mistake would make Page Control fail in some cases. I only mention this here because it was a nasty little bug I could never locate. So anyone having that problem should consider upgrading.

-> Added control options to admin->Configuration.

-> Added additional meta tag options. It is doubtful these will be used that much but a number of requests were received for this option so it was added.

-> Added an option to view the title and meta tags on the actual web page from admin.

-> Added Social Bookmark code.

-> Added code to apply mouseover text to the sites logo - unique for each page.

-> Added code to have the breadcrumb use the header tags titles.

-> Added an exclude list in admin/includes/functions/header_tags.php that prevents header tags code from being added to certain files (like checkout pages). This is because those pages don't need tags and excluding them will simplify matters.

-> Added option to Page Control and Fill Tags so that the keywords can be dynamically generated from the pages on the site. Currently, the code only supports single keywords but I plan on changing that. There is an option in admin to only pick keywords that fall within the keyword density settings.

-> Added an automatic page add feature. You still have to edit the actual file in the root but that's all.

-> Added easy install instruction for STS shops. There is just one change to make and the two contribution work together.

-> Added code to have the new features work with BTS based shops. There may be a few cases where an option doesn't work due to how BTS handles the files, but they should be minimal and not anything to cause a great stir.

-> Changed how title, description and keywords are built. This should provide more flexibility for those that want that option. Each item has a sort order and is displayed in the string of text based on that sort order. So, for example, the title of a page can contain some entered text, the default title and the category and manufacturers names (if applicable), in any order.

-> Added an Un-Install file to completely remove Header Tags from the database. This should make testing and troubleshooting easier.

-> Added code to use curl instead of standard php file calls. The code will try curl first and then switch to a file command if it is not present.

-> Tested in MS2, RC2, STS and BTS shops.

 

 

Special thanks to the following for their suggestions:

 

bkellum

java roasters

surfalot

 

A lot of time went into creating this contribuiton. I hope it proves useful.

 

Jack

Edited by Jack_mcs
Biancoblu likes this

Share this post


Link to post
Share on other sites

I'm looking forward to playing with this. Thanks for all of the energy you put into it. :thumbsup:

Share this post


Link to post
Share on other sites

thank you

 

i have install your contrib Header Tags Controller V2.6.3 Complete ... must i deinstall it to install this contrib ?

 

best regards

Edited by paulchen2005

Share this post


Link to post
Share on other sites

Adam & Bill - thanks.

 

Paul - there is an update file with instructions on how to convert your version to this one. There weren't any changes to the admin/categories.php file, which is the most difficult part of the installation, but there are still quite a few changes. Just be sure to backup your database before trying the conversion.

 

Jack

Share this post


Link to post
Share on other sites

As always, Great work Jack.

I installed this from the update file last night, everything went smooth. This thing is awesome!

However, you did leave out a few things in the upgrade instructions --- uploading the social bookmark module and overwriting the includes/headertags.php and includes/functions headertags.php

Nothing anyone thats already installed the previous version cant figure out.

Thanks

Share this post


Link to post
Share on other sites

Wnated to confirm this block of code:

In catalog/includes/header_tags.php

Lines 65 & 66 read:

case (basename($PHP_SELF)==FILENAME_PRODUCT_REVIEWS_INFO):  $filename = FILENAME_PRODUCT_REVIEWS; break; 
 case (basename($PHP_SELF)==FILENAME_PRODUCT_REVIEWS_WRITE): $filename = FILENAME_PRODUCT_WRITE;   break;

 

Is that correct? Or should it be:

case (basename($PHP_SELF)==FILENAME_PRODUCT_REVIEWS_INFO):  $filename = FILENAME_PRODUCT_REVIEWS_INFO; break; 
 case (basename($PHP_SELF)==FILENAME_PRODUCT_REVIEWS_WRITE): $filename = FILENAME_PRODUCT_REVIEWS_WRITE;   break;

Share this post


Link to post
Share on other sites

I'm gonna add an upgrade with an extremely useless addition that will be irrelevant to all but those who live in a tiny village in the most northern reaches of Lapland muahahaha! (sorry I've had a few beers tonight I'll get my coat)

 

Nice work Jack looks great! I'll bash it about a bit and feed back.

Edited by FWR Media

Share this post


Link to post
Share on other sites
Wnated to confirm this block of code:

In catalog/includes/header_tags.php

Lines 65 & 66 read:

case (basename($PHP_SELF)==FILENAME_PRODUCT_REVIEWS_INFO):  $filename = FILENAME_PRODUCT_REVIEWS; break; 
 case (basename($PHP_SELF)==FILENAME_PRODUCT_REVIEWS_WRITE): $filename = FILENAME_PRODUCT_WRITE;   break;

 

Is that correct? Or should it be:

case (basename($PHP_SELF)==FILENAME_PRODUCT_REVIEWS_INFO):  $filename = FILENAME_PRODUCT_REVIEWS_INFO; break; 
 case (basename($PHP_SELF)==FILENAME_PRODUCT_REVIEWS_WRITE): $filename = FILENAME_PRODUCT_REVIEWS_WRITE;   break;

Yes, you are correct. The change you posted is the correct code.

 

Jack

Share this post


Link to post
Share on other sites

Okay. I'm going to use a duplicate I made of my store and database to test this. I really liked the way HTC worked, so I am looking forward to the results this will bring.

 

~~~Tapuahk

Share this post


Link to post
Share on other sites

USING:

 

Update instructions for updating Header Tags Controller version 2.6.3 to

Header Tags SEO V 3.0 by Jack_mcs

 

Step 3 says:

 

Find the following line in admin/includes/filenames.php

 

define('FILENAME_HEADER_TAGS_CONTROLLER', 'header_tags_controller.php');

define('FILENAME_HEADER_TAGS_ENGLISH', 'header_tags_english.php');

 

and Replace it with delete it

 

/*** Begin Header Tags SEO ***/

define('FILENAME_HEADER_TAGS_SEO', 'header_tags_seo.php');

define('FILENAME_HEADER_TAGS_FILL_TAGS', 'header_tags_fill_tags.php');

/*** End Header Tags SEO ***/

 

But I found this:

 

// define HTC

define('FILENAME_HEADER_TAGS_CONTROLLER', 'header_tags_controller.php');

define('FILENAME_HEADER_TAGS_ENGLISH', 'header_tags_english.php');

define('FILENAME_HEADER_TAGS_FILL_TAGS', 'header_tags_fill_tags.php');

 

I don't think I should have to define the same thing twice so I deleted all three lines not just the two.

 

 

~~~Tapuahk

Share this post


Link to post
Share on other sites
Step 3 says:

But I found this:

I don't think I should have to define the same thing twice so I deleted all three lines not just the two.

~~~Tapuahk

I'm not sure I follow but you will need the definitions for this contribution. If you do it wrong, it will just display the text in capital letters so it will be obvious where the mistake it.

 

Jack

Share this post


Link to post
Share on other sites

Update instructions for updating Header Tags Controller version 2.6.3 to

Header Tags SEO V 3.0 by Jack_mcs

 

 

says

12) Find the following in catalog/index.php

 

<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td>

 

i think you meant catalog/product_info.php

 

??

Share this post


Link to post
Share on other sites
I'm not sure I follow but you will need the definitions for this contribution. If you do it wrong, it will just display the text in capital letters so it will be obvious where the mistake it.

 

Jack

 

Just saying if I blindly follow instructions I would have two lines saying

 

define('FILENAME_HEADER_TAGS_FILL_TAGS', 'header_tags_fill_tags.php');

 

as a line saying

 

define('FILENAME_HEADER_TAGS_FILL_TAGS', 'header_tags_fill_tags.php');

 

exists and you don't say to remove it.

Share this post


Link to post
Share on other sites

Received the following error when running admin/headertags_seo_update.php

 

admin/headertags_seo_update.php

 

Warning: mysql_fetch_field(): supplied argument is not a valid MySQL result resource in /international/catalog/admin/includes/functions/database.php on line 125

 

Administration | Online Catalog | Support Site Logged in as: admin (Logoff)

Header Tags Controller Setup

 

 

Database successfully updated!!!

 

???

 

I'm stopping here until I figure what went wrong.

Edited by tapuahk

Share this post


Link to post
Share on other sites

Hey Jack,

 

Thanks for the contribution..

 

Im having a slight problem.. doesnt really make sense so maybe you can help..

 

everything has been installed..

 

I ran fill tags..

 

Now in the SEO Page.. I have setup the default tags and data... I selected one of the pages on the site.. and just hit the checkboxes (do I need to enter numbers beside them or can I leave them blank) .. I left the the other text fields for the specific page blank.. I hit 'view result' and it came back with

 

New Home Page Title

new description

new keywords1,keywords2

 

Shouldnt it come back with the default data on the right side of the page?

 

So I then tried entering something into the text fields of the specific page..

 

Then when I view result .. it comes back with the default data from the right side of the page.. BUT it doesnt include the data I entered in the text boxes for the specific page.. two peculiar results which don't make sense to me..

 

any thoughts?

 

J

Share this post


Link to post
Share on other sites

Ok im pretty sure this is the problem

 

in catalog/includes/header_tags.php

// ALL OTHER PAGES NOT DEFINED ABOVE
 default:
$header_tags_array['title'] = tep_db_prepare_input($defaultTags['default_title']);
$header_tags_array['desc'] = tep_db_prepare_input($defaultTags['default_description']);
$header_tags_array['keywords'] = tep_db_prepare_input($defaultTags['default_keywords']);
break;
 }

 

Shouldnt the default tags be appended to the tags of each specific page.. this section seems incomplete... it seems it is why each page no matter what I set the tags to .. only the default tags are showing up..

Share this post


Link to post
Share on other sites
Received the following error when running admin/headertags_seo_update.php

 

admin/headertags_seo_update.php

 

Warning: mysql_fetch_field(): supplied argument is not a valid MySQL result resource in /international/catalog/admin/includes/functions/database.php on line 125

 

Administration | Online Catalog | Support Site Logged in as: admin (Logoff)

Header Tags Controller Setup

 

 

Database successfully updated!!!

 

???

 

I'm stopping here until I figure what went wrong.

I saw that on a few of the servers I installed it on. It probably has to do with the php version but the script runs successfully so it can be ignored.

 

Jack

Share this post


Link to post
Share on other sites
Hey Jack,

 

Thanks for the contribution..

 

Im having a slight problem.. doesnt really make sense so maybe you can help..

 

everything has been installed..

 

I ran fill tags..

 

Now in the SEO Page.. I have setup the default tags and data... I selected one of the pages on the site.. and just hit the checkboxes (do I need to enter numbers beside them or can I leave them blank) .. I left the the other text fields for the specific page blank.. I hit 'view result' and it came back with

J

You have to enter a sort number.

 

Jack

Edited by Jack_mcs

Share this post


Link to post
Share on other sites
You have to enter a sort number.

 

Jack

 

Jack.. I did add sort numbers and they had no effect.. not until I changed the code from this (in catalog/includes/header_tags.php) did it finally work as it should.. with still a slight hiccup in the admin section with respect to sort orders (below)

 

// ALL OTHER PAGES NOT DEFINED ABOVE
 default:
$header_tags_array['title'] = tep_db_prepare_input($defaultTags['default_title']);
$header_tags_array['desc'] = tep_db_prepare_input($defaultTags['default_description']);
$header_tags_array['keywords'] = tep_db_prepare_input($defaultTags['default_keywords']);
break;
 }

 

to this

 

// ALL OTHER PAGES NOT DEFINED ABOVE
 default:
$pageTags_query = tep_db_query("select * from " . TABLE_HEADERTAGS . " where page_name like '" . basename($PHP_SELF) . "' and language_id = '" . (int)$languages_id . "'");
$pageTags = tep_db_fetch_array($pageTags_query);  

$sortOrder['title'][0] = $pageTags['page_title'];
$sortOrder['description'][0] = $pageTags['page_description']; 
$sortOrder['keywords'][0] = $pageTags['page_keywords'];
$sortOrder['logo'][0] = $pageTags['page_logo']; 

if ($pageTags['append_default_title'] && tep_not_null($tmpTags['def_title'])) $sortOrder['title'][$pageTags['sortorder_title']] = $tmpTags['def_title'];
if ($pageTags['append_default_description'] && tep_not_null($tmpTags['def_desc'])) $sortOrder['description'][$pageTags['sortorder_description']] = $tmpTags['def_desc'];
if ($pageTags['append_default_keywords'] && tep_not_null($tmpTags['def_keywords'])) $sortOrder['keywords'][$pageTags['sortorder_keywords']] = $tmpTags['def_keywords'];
if ($pageTags['append_default_logo'] && tep_not_null($tmpTags['def_logo_text']))  $sortOrder['logo'][$pageTags['sortorder_logo']] = $tmpTags['def_logo_text'];

FillHeaderTagsArray($header_tags_array, $sortOrder);  
break;
 }

 

 

As for the sort orders.. I get these errors..

 

Error Duplicate sort orders are not allowed -> buy.php

Error Duplicate sort orders are not allowed -> buy.php

Error Duplicate sort orders are not allowed -> buy.php

 

I put in a sort order of 2 for the title and sort order of 2 for description.. I dont see why this is a problem..

 

However, with the change in code above.. specific page titles are now being appended by the default page titles.. this wasnt happening before..

Edited by insaini

Share this post


Link to post
Share on other sites
Error Duplicate sort orders are not allowed -> buy.php

Error Duplicate sort orders are not allowed -> buy.php

Error Duplicate sort orders are not allowed -> buy.php

 

I put in a sort order of 2 for the title and sort order of 2 for description.. I dont see why this is a problem..

 

However, with the change in code above.. specific page titles are now being appended by the default page titles.. this wasnt happening before..

The error message says duplicate sort orders are not allowed but you have decided that is not the case. So you are editing the code to make it fit your idea of the way it should work. That is fine but it isn't necessary. If you set it up properly, it will work.

 

Jack

Share this post


Link to post
Share on other sites

A new version has been uploaded. Thanks to everyone that found problems with the code and instructions. I hope this new version fixes all of those problems. The following changes were made.

 

-> Fixed coding mistake in includes/header_tags.php for reviews pages

-> Added code to clear separators if a field is missing

-> Added code to display an error if the sort order filed is missing

-> Update convert instructions

 

Jack

Share this post


Link to post
Share on other sites
The error message says duplicate sort orders are not allowed but you have decided that is not the case. So you are editing the code to make it fit your idea of the way it should work. That is fine but it isn't necessary. If you set it up properly, it will work.

 

Jack

 

 

No I havent touched anything to do with Sort Orders.. .. the code I changed was necessary to show the Page Title appended with the Default Page title..

 

Im not sure why you dont see that it seems pretty obvious that code change needs to be done..

 

Basically.. take any page say 'Contact Us'

 

Now fresh out of the box this is what the browser says for its title .. ( - Mozilla Firefox )

Now I set up the default page title, description and keywords (say "WEBPAGE" for each title, description and keywords) in admin .. now that same 'Contact Us' page now says .. ( WEBPAGE - Mozilla Firefox )

 

Now I specify for the 'Contact Us' page .. Title, description and keywords as "Contact Us" .. now when I go to the Contact Us page.. behold the title still says ( WEBPAGE - Mozilla Firefox ) .. when it should say .. ( Contact Us - WEBPAGE - Mozilla Firefox ) ..

 

Well that code change i posted above fixes this .. not sure why you didnt get this.. :huh:

Share this post


Link to post
Share on other sites
No I havent touched anything to do with Sort Orders.. .. the code I changed was necessary to show the Page Title appended with the Default Page title..

 

Im not sure why you dont see that it seems pretty obvious that code change needs to be done..

 

Basically.. take any page say 'Contact Us'

 

Now fresh out of the box this is what the browser says for its title .. ( - Mozilla Firefox )

Now I set up the default page title, description and keywords (say "WEBPAGE" for each title, description and keywords) in admin .. now that same 'Contact Us' page now says .. ( WEBPAGE - Mozilla Firefox )

 

Now I specify for the 'Contact Us' page .. Title, description and keywords as "Contact Us" .. now when I go to the Contact Us page.. behold the title still says ( WEBPAGE - Mozilla Firefox ) .. when it should say .. ( Contact Us - WEBPAGE - Mozilla Firefox ) ..

 

Well that code change i posted above fixes this .. not sure why you didnt get this.. :huh:

It works fine for me as it is. Maybe some others can test it to see if it happens for them. The only thing I can think of is that the includes/header_tags.php file was not updated properly for some reason. Try replacing that file with the original and then run the headertags_seo_uninstall.php and the headertags_seo_install.php files.

 

Jack

Share this post


Link to post
Share on other sites

Thanks Jack, :thumbsup:

 

The new instructions worked great on test site, will be doing live store now. :rolleyes:

 

~~~Tapuahk

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now