Jump to content
Sign in to follow this  
Farrukh

[Contribution] Header Tags Controller for Admin MS 2.2

Recommended Posts

If you look at the english/header_tags.php file, you will see a default section. This is used for all pages listed in the file if the option is set to use it, which it is by default. You have to edit that file to display something else.

 

Are you saying the url is changed after installing Header Tags? If so, I don't see how that is possible since it doesn't do anything that would change that.

 

Jack

Share this post


Link to post
Share on other sites

Hi jack

 

thanks for all you help and sorry to be a pain, i have tried and tried to change the meta tags from default to what i have put down, i have change the 1 to a zero, zero to a 1 and even left it blank but when i use a tool to see what they say, it keeps coming up with what is written in default only.

 

<?php

// /catalog/includes/languages/english/header_tags.php

// WebMakers.com Added: Header Tags Generator v2.3

// Add META TAGS and Modify TITLE

//

// DEFINITIONS FOR /includes/languages/english/header_tags.php

 

// Define your email address to appear on all pages

define('HEAD_REPLY_TAG_ALL',STORE_OWNER_EMAIL_ADDRESS);

 

// For all pages not defined or left blank, and for products not defined

// These are included unless you set the toggle switch in each section below to OFF ( '0' )

// The HEAD_TITLE_TAG_ALL is included BEFORE the specific one for the page

// The HEAD_DESC_TAG_ALL is included AFTER the specific one for the page

// The HEAD_KEY_TAG_ALL is included AFTER the specific one for the page

define('HEAD_TITLE_TAG_ALL','');

define('HEAD_DESC_TAG_ALL','baby clothing, shoes, & accessories, baby shoes and baby clothing in colourful & stylish designs so your little ones can look fabulous all year round');

define('HEAD_KEY_TAG_ALL','baby shoes,baby clothes,babies footwear,infant shoes,toddler footwear,toddlers clothing,infants clothing,babygrows,baby gift sets,junior fashion,soft sole shoes,infant wear');

 

// DEFINE TAGS FOR INDIVIDUAL PAGES

 

 

// product_info.php - if left blank in products_description table these values will be used

define('HTTA_PRODUCT_INFO_ON','1');

define('HTKA_PRODUCT_INFO_ON','1');

define('HTDA_PRODUCT_INFO_ON','1');

define('HEAD_TITLE_TAG_PRODUCT_INFO','product info for baby clothes');

define('HEAD_DESC_TAG_PRODUCT_INFO','baby clothes');

define('HEAD_KEY_TAG_PRODUCT_INFO','baby clothes');

 

above is a sample of what i have done and if i write baby clothes it does put it in the head-key ect part, so that is fine but as i said when i use the tool to check my metas it say the default part here :

 

define('HEAD_KEY_TAG_ALL','baby shoes,baby clothes,babies footwear,infant shoes,toddler footwear,toddlers clothing,infants clothing,babygrows,baby gift sets,junior fashion,soft sole shoes,infant wear');

 

 

so i must be doing something wrong, for it is not switching from default to what i would like it too say.

 

hope im not doing your head in.

 

many thanks

Edited by rommany

Share this post


Link to post
Share on other sites

The problem with the product pages is actually a bug, sort of. The tags defined for the product_info section in english/header_tags.php have never been added to the code in includes/header_tags.php. So this has not ever worked on any version of Header Tags. The most likely reason it was never noticed is because it is not needed. The title and meta tags for products are set in the database. The existing code will add the default title and meta tags to those if you have the switch set correctly. Now, the length of the title for google should be between 60-80 characters. For Yahoo, up to 100 as I recall. If a third description is added to the title, it becomes too long and will be truncated, at best. If it is just redundant words, it can be considered spamming. So if you decide to use it, be careful with it.

 

With all of that said, if you want to change the code to allow those items to be added, find the following in includes/header_tags.php:

 if (empty($the_product_info['products_head_title_tag'])) {
     $tags_array['title']= HEAD_TITLE_TAG_ALL;
   } else {
     if ( HTTA_PRODUCT_INFO_ON=='1' ) {
       $tags_array['title']= clean_html_comments($the_product_info['products_head_title_tag']) . HEAD_TITLE_TAG_ALL;
     } else {
       $tags_array['title']= clean_html_comments($the_product_info['products_head_title_tag']);
     }
   }

and change it to

 if (empty($the_product_info['products_head_title_tag'])) {
     $tags_array['title']= HEAD_TITLE_TAG_PRODUCT_INFO . ' ' . HEAD_TITLE_TAG_ALL;
   } else {
     if ( HTTA_PRODUCT_INFO_ON=='1' ) {
       $tags_array['title']= clean_html_comments($the_product_info['products_head_title_tag']) . HEAD_TITLE_TAG_PRODUCT_INFO . ' ' . HEAD_TITLE_TAG_ALL;
     } else {
       $tags_array['title']= clean_html_comments($the_product_info['products_head_title_tag']);
     }
   }

You will also need to edit the code for the meta tags in the same way. The above will fix the products page problem you are having but will do nothing for the index and specials pages you mentioned. You will need to post the code for those too if the problem still exists.

 

Jack

Share this post


Link to post
Share on other sites

I haven't done it myself but I have seen such shops with it installed. It is not as "easy" as installing in a stock shop but that is pretty much the case of any contribution with that system.

 

Jack

Share this post


Link to post
Share on other sites

I have uploaded a new version.

 

- added an option to display categories description.

- fixed problem with fill tags in which the language wasn't being recognized for the category tags. Fill tags now must be ran from admin since it calls a function that only resides in the admin section.

 

Jack

Share this post


Link to post
Share on other sites
I have uploaded a new version.

 

- added an option to display categories description.

- fixed problem with fill tags in which the language wasn't being recognized for the category tags.  Fill tags now must be ran from admin since it calls a function that only resides in the admin section.

 

Jack

 

Hi,

 

I use HTC 2.4.9 with MS 2. My Problem:

 

Fatal error: Call to undefined function: tep_get_products_head_title_tag() in /home/dark-hamburgde/public_html/catalog/admin/categories.php on line 902

 

This Error is still here in the Thread, but I dont?t find the error.

 

function tep_get_products_description($product_id, $language_id) {
   $product_query = tep_db_query("select products_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'");
   $product = tep_db_fetch_array($product_query);
   return $product['products_description'];
}
 function tep_get_products_head_title_tag($product_id, $language_id) {
   $product_query = tep_db_query("select products_head_title_tag from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'");
   $product = tep_db_fetch_array($product_query);
   return $product['products_head_title_tag'];
 }
 function tep_get_products_head_desc_tag($product_id, $language_id) {
   $product_query = tep_db_query("select products_head_desc_tag from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'");
   $product = tep_db_fetch_array($product_query);
   return $product['products_head_desc_tag'];
 }
 function tep_get_products_head_keywords_tag($product_id, $language_id) {
   $product_query = tep_db_query("select products_head_keywords_tag from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'");
   $product = tep_db_fetch_array($product_query);
   return $product['products_head_keywords_tag'];
 }

 

 

Line 902:

<td class="main"><?php echo tep_draw_textarea_field('products_head_title_tag[' . $languages[$i]['id'] . ']', 'soft', '70', '5', (isset($products_head_title_tag[$languages[$i]['id']]) ? $products_head_title_tag[$languages[$i]['id']] : tep_get_products_head_title_tag($pInfo->products_id, $languages[$i]['id']))); ?></td>

 

Thanks a lot...

 

Nun verst?ndlich auf Deutsch ;-)

Der oben beschriebene Fehler taucht hier des ?fteren auf, jedoch hat die Abhilfe bei mir nicht funktioniert. Evtl. habe ich etwas ?bersehen.

Danke!

 

Gru?

Reinhard

Share this post


Link to post
Share on other sites

Hi all!

I just added the admin section and I get this error:

 

 

Warning: chmod(): Operation not permitted in /home/public_html/admin/includes/functions/header_tags.php on line 194

Cannot change the mode of file (../includes/languages/english/header_tags.php)

 

 

What does this mean?

Thanks in advance,

logcbnfvr


Log Cabin Fever Gifts

Share this post


Link to post
Share on other sites

This Constribution works fine, thx to Jack.

 

The HTML-Area in the ACP is a little bit to small.

 

dark-hamburg.jpg

 

This is Firefox. IE is similar.

 

Any suggestions?

 

Gru? Reinhard

Share this post


Link to post
Share on other sites
Hi all!

I just added the admin section and I get this error:

Warning: chmod(): Operation not permitted in /home/public_html/admin/includes/functions/header_tags.php on line 194

Cannot change the mode of file (../includes/languages/english/header_tags.php)

What does this mean?

Thanks in advance,

logcbnfvr

If you read back through the thread a few pages, you should find mention of this problem. It is because your host is preventing the code from chaniging permission. Try changing the permission in the includes/header_tags.php and english/header_tags.php yourself to 777 and see if that helps. If not, you won;t be able to use that section since your host is preventing it.

 

Jack

Share this post


Link to post
Share on other sites
This Constribution works fine, thx to Jack.

 

The HTML-Area in the ACP is a little bit to small.

 

dark-hamburg.jpg

 

This is Firefox. IE is similar.

 

Any suggestions?

 

Gru? Reinhard

I'm not sure what the above refers to. Are you sure you mean to ask on the Header Tags thread?

 

Jack

Share this post


Link to post
Share on other sites
If you read back through the thread a few pages, you should find mention of this problem. It is because your host is preventing the code from chaniging permission. Try changing the permission in the includes/header_tags.php and english/header_tags.php yourself to 777 and see if that helps. If not, you won;t be able to use that section since your host is preventing it.

 

Jack

 

 

Thank you Jack, that did it! I did look in this forum a long time, tried to do a search for chmode too... I guess I couldn't see it for looking, sorry to bug ya and thanks a bunch!

logcbnfvr


Log Cabin Fever Gifts

Share this post


Link to post
Share on other sites

Kim - you didn't bother me. I never mind answering questions. I was just trying to point out, probably in a clumbsy sort of way, that some answers already exist and it can save a person a lot of time by looking back through the thread. Of course, this is a long thread and I probably wouldn't have much patience after the first 2-3 pages so I understand the need to ask.

 

Reinhard - Then I am totally lost as to what your question is about. The image you posted has nothing to do with Header Tags that I can tell. What am I missing?

 

Jack

Share this post


Link to post
Share on other sites

In Install_Admin.TXT it says:

 

If you have installed other contributions, then you

should only copy the following files. You will need to edit the other

files with the instructions below.

 

admin/header_tags_controller.php

admin/header_tags_english.php

admin/includes/functions/header_tags.php

admin/includes/boxes/header_tags_controller.php

admin/includes/languages/english/header_tags_controller.php

 

The file admin/header_tags_english.php is missing from the zip file... I downloaded the latest zip file from June 10th at http://www.oscommerce.com/community/contributions,207

Edited by Sunsmile

Share this post


Link to post
Share on other sites

Try the 2.4.9 version. For some reason, people refuse to upload full versions and it causes this sort of problem. If you need whatever was changed in the other versions, you will need to grab those too.

 

Jack

Share this post


Link to post
Share on other sites
Try the 2.4.9 version. For some reason, people refuse to upload full versions and it causes this sort of problem. If you need whatever was changed in the other versions, you will need to grab those too.

 

Jack

 

I downloaded it, and it has the file. Thank you!

 

Also, the June 10th version has a bug.

 

Fatal error: Call to undefined function: tep_admin_files_boxes() in /home/silverje/public_html/catalog/admin/includes/boxes/header_tags_controller.php on line 28

 

When I replaced /catalog/admin/includes/boxes/header_tags_controller.php with the file from 2.4.9 version, the error went away.

Share this post


Link to post
Share on other sites

Hi all,

 

2.49 works fine :-), but I?ve a little Problem or find a little bug with an other Constribution.

 

After 2.49 I installed SEO 2.1c from Chemo. After this, the Productname is no longer shown in the Title.

 

Any Suggestions?

 

Thanks

Reinhard

Share this post


Link to post
Share on other sites

You'll need to ask on that support thread. Ultimate SEO 2.0 works fine with Header Tags but a lot of people have had problems with 2.1.

 

Jack

Share this post


Link to post
Share on other sites

Hi,

I am hoping someone can help me with my install. I installed HTC back in March sometime and didn't test it all that thoroughly because it seemed to be working. Lately I have noticed that my titles in the browser are not changing when I am looking at various category levels, only when I look at products. I went in tonight to install the upgrade and new versions that have come available since then and I think I installed a wierd combination of both. Everything is working ok, but I don't seem to have 100% functionality of the new admin side and my category titles are still not showing up.

 

I don't care that much about having the admin control (i'm actually not entirely sure what it does). but what is most important to me is to get the dynamic title changes when I am looking at various categories. I think this contribution is supposed to do that and I have all of the categories defined with titles, keywords, descriptions, etc.

 

One thing I did notice is that my title right now seems to be controlled by my definition in catalog/includes/languages/english.php under the title definition rather than by any of the changes made in catalog/includes/languages/english/header_tags.php.

 

Can anyone help me figure out how to get my titles to change based upon what I define in admin/categories?

 

for reference, you can check out what is happening on my site here: momentsofelegance.com

 

Thanks so much!!

Ashley

Share this post


Link to post
Share on other sites

I looked at your site and the few pages I looked at doesn't have the code for the title change installed. You need to change almost all of the files in your root to have the title change for each of those pages.

 

Once your code is working properly, you will need to change the title to match your site. In earlier versions, you would need to edit the english/header_tags.php file to do this. That's the purpose of the admin tool. You just type in the new title for the appropriate page and it's done. No downloading and editing the file as before.

 

Jack

Share this post


Link to post
Share on other sites

Installed the admin and it works for the most part. However...

 

1) When i add a new page and type a title, it adds the Page Name value in the Title field, instead of the title I type. I can edit this from the Text Control page with no problems....but did I screw something up?

 

2) Works with all of my pages...except...when I add a custom page for wishlist.php (My Wishlist 2.0 contribution), I get the following error (throuhgout my store):

 

Parse error: parse error, unexpected T_CASE in /home/angarden/public_html/shop/includes/header_tags.php on line 375

 

My line 375 looks like this:

 

  case (strstr($_SERVER['PHP_SELF'],FILENAME_WISHLIST) or strstr($PHP_SELF, FILENAME_WISHLIST));

 

Nothing out of the ordinary as far as I can see. Deleting the wishlist file takes care of everything.

 

Do I need to do something to enable HTC to work with custom pages?

 

I am mostly concerned with problem 1 though, as it is a PITA.

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
Sign in to follow this  

×