Jump to content
Latest News: (loading..)
FWR Media

KissMT Dynamic SEO Meta & Canonical Header Tags

Recommended Posts

@@FWR Media

Would you guide me to which function I have to Modify??

 

catalog/includes/modules/kiss_meta_tags/modules/product_info.php

 

Find ine 24:

 

  $this->products_query = "SELECT p.products_model, pd.products_name, pd.products_description, m.manufacturers_name FROM " . TABLE_PRODUCTS . " p INNER JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON pd.products_id = p.products_id AND pd.language_id = :languages_id LEFT JOIN " . TABLE_MANUFACTURERS . " m ON m.manufacturers_id = p.manufacturers_id WHERE p.products_id = :products_id";

 

Change to:

 

	
 $this->products_query = "SELECT p.products_model, p.ISBN, p.Author, pd.products_name, pd.products_description, m.manufacturers_name FROM " . TABLE_PRODUCTS . " p INNER JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON pd.products_id = p.products_id AND pd.language_id = :languages_id LEFT JOIN " . TABLE_MANUFACTURERS . " m ON m.manufacturers_id = p.manufacturers_id WHERE p.products_id = :products_id";

 

Find line 53

 

$leading_values .= '[-separator-]' . implode( '[-separator-]', $breadcrumb );

 

Add immediately ABOVE:

 

  if ( tep_not_null( $product_results['ISBN'] ) ) {  
	 $leading_values .= '[-separator-]' . trim( $product_results['ISBN'] );
  }
  if ( tep_not_null( $product_results['Author'] ) ) {  
	 $leading_values .= '[-separator-]' . trim( $product_results['Author'] );
  }

Edited by FWR Media

Share this post


Link to post
Share on other sites

can't imagine anything in there that's not good for 2.3.2+

Share this post


Link to post
Share on other sites

Hello, i want to modify content of title and description meta tag. I managed to eliminate for example manufacturer name, by editing catalog/includes/modules/kiss_meta_tags/modules/product_info.php. From there i can eliminate some content (manufacturer, product model) for both title and description tag. Now i want to eliminate product description just from title tag. How can i do that? Thank you and excuse my english :)

Share this post


Link to post
Share on other sites

Now i want to eliminate product description just from title tag. How can i do that? Thank you and excuse my english :)

 

Your English is great!

 

That's a setting in admin I think.

 

or check the language file catalog/includes/languages/[my language]/kissmt.php

 

KISSMT_HOMEPAGE_DESCRIPTION, STORE_NAME

Edited by FWR Media

Share this post


Link to post
Share on other sites

I did that modifications in language file but was not quite what i wanted, so i changed line 159 in includes/modules/kiss_meta_tags/abstracts/kiss_modules.php

from: $full_title = ( $leading_values . ( tep_not_null( $description) ? '[-separator-]' . $description : '' ) );

to: $full_title = ( $leading_values );

and now is working as i needed. I am not an php programer so i wonder if is not a better way to do this?

Share this post


Link to post
Share on other sites

it looks like I have KISS Meta Tags SEO v1.0

 

don't see any info on updates or changes to the version above^ to the one being discussed here (KissMT Dynamic SEO Meta & Canonical Header Tags)

 

1. ideas on how to proceed in getting rid of old and/or changing to new?

2. now that 2.3.2 and 2.3.3 have a stock header tag module...how should we go about using the stock or the KISS version-- should the stock one be turned off completely, or some features used and others not?

Edited by ErikMM

Web Developer, Firebug, and Notepad++ are powerful free tools for web design.

Share this post


Link to post
Share on other sites

So it looks like the KISS Meta Tags SEO v1 may have been version 55, but I'm not sure? Regardless, there is a handy upgrade instruction with the new package r72 (http://addons.oscommerce.com/info/7199).

 

The reason for my post^ above is that the new package is confusingly called "KissMT Dynamic SEO Meta & Canonical Header Tags" BUT the upgrade is called "KissMT Dynamic SEO Meta Tags version 1.0" (Upgrade revision 55 to r72)

 

So, it's a little confusing as to what I had running and what the upgrade is actually called, or what the old one was actually called, but what the hell, it was so easy to upgrade that it really doesn't matter. I simply wrote over the old (or maybe old, i.e. 55) catalog/includes/modules/kiss_meta_tags folder with the new folder and contents. FTP, 30 seconds. Done.

 

Still not sure what to do about #2^, but I'm going to turn off the stock module and just use r72.


Web Developer, Firebug, and Notepad++ are powerful free tools for web design.

Share this post


Link to post
Share on other sites

Hi Erik

 

Glad the upgrade was easy for you .. KISS by name KISS by nature :)

 

Not sure what was going on in my mind with the name change and I understand it would have created confusion.

 

Still not sure what to do about #2^, but I'm going to turn off the stock module and just use r72.

 

Well it's great that the stock system offers meta tags and canonical elements now but it doesn't .. yet .. match the functionality of KissMT.

 

Once 2.4 is more "obvious in its nature" I will probably modify KissMT to add to the osCommerce module system as opposed to replace it. Or I may even push a mod through GIT to see if it can become a part of the core system .. god forbid :)

Edited by FWR Media

Share this post


Link to post
Share on other sites

Hi Robert.

 

Please can you take another look at the module - product_reviews_info.php

 

Lines 61 and 62 are doing nothing

  if ( tep_not_null( $product_results['reviews_text'] ) ) {
  }

Also, I cannot get the customers name to be added to the review meta tags.

I seem to recall that I initially removed the customers name deliberately however this causes duplicates when a product gets more than one review. I wanted to put the customers name back into the meta tags to avoid this.

 

Regards

 

Ken

Share this post


Link to post
Share on other sites

@@Ken44

 

Hi Ken44 great to see you again, been a long time!!!

 

I'll have to coherse you and a few known others to log into my site :)

 

Onto the point:

 

Reviews text was put there "in case" but was designed as a void function. What have you changed exactly?

Share this post


Link to post
Share on other sites

Hi Rob

 

Yeah, been a while. I hope everything is OK with you.

 

I'll have to coherse you and a few known others to log into my site

 

Dev site or Forum?

 

Re KissMT

 

I started to get duplicates on product reviews that had more than one review. I recall that the customers name was added to avoid this so I downloaded the latest version KissMT_1.0_r72_RC and installed it; however I still cannot get the customers name in the meta tags.

 

Lines 61 and 62 are doing nothing. I have not altered anything. It is how I downloaded it.

 

Regards

 

Ken

Share this post


Link to post
Share on other sites

Well the latest version in the repository is 78 so perhaps it has the changes you mention.

 

Dev site or Forum?

 

Same thing I think, logging into the site is logging into the forum .. it's new so may not work very well :)

Share this post


Link to post
Share on other sites

Hi Rob

 

The latest version for osc2.3 is KissMT_1.0_r76.

The latest version for osc2.2 is KissMT_1.0_r72_RC (which I am using)

 

I found the problem – I had changed

 

// product_reviews_info.php

define( 'KISSMT_PRODUCT_REVIEWS_INFO_TEXT', 'Product review by %s' );

 

in \includes\languages\english\kissmt.php

 

Because the customers name was not included in the meta tags I was getting duplicates when a product gets more that one review.

 

All sorted now. :thumbsup:

 

Thanks.

 

Ken

Share this post


Link to post
Share on other sites

@@Ken44

 

Glad you got it sorted m8 :thumbsup:

Share this post


Link to post
Share on other sites

Hi Rob,

 

I would like to extend the functionality of your fantastic contribution so that it will produce meta tags and a canonical URL for a custom blog area of my oscommerce installation, and I wondered if you could provide some guidance please? I don't need specific instructions on what I should write in terms of code, I only need a gentle nudge in the right direction towards the files I need to edit.

 

There is one file serving my blog content, which is rather imaginatively called blog.php. A "c" querystring appended to the URL denotes that a blog category should be displayed, "c" and "a" querystrings are displayed when an article is displayed.

 

Having seen the files located in "/includes/modules/kiss_meta_tags/modules", I am thinking that maybe I need to clone one of those files (maybe the one for product_info.php), rename it "blog.php", and edit the contents so that it pulls values from the blog table in my database prior to calling the KissMT class?

 

If I am on the right track, is there anything else that I need to do, or will your code automatically use the module when a visitor hits the "blog.php" page?

 

 

Many thanks for any help you are able to provide,

Paul

Share this post


Link to post
Share on other sites

Hi Robert,

 

I noticed something strange. I have 2 categories with HTML tags in their name, to put some emphasis on the categories list, but when I go the the category page, I see the tags written there as text. I give you a concrete example, one of them is <b>Christmas Specials</b>, and it works ok in the categories list as the name in Bold, but when I load the category page I see <b>Christmas Specials</b> as the title. The title meta tag is ok.

I see the same behavior in the breadcrumb, but maybe here is not due to your contribution.

 

I tried to change in index.php from

echo KissMT::init()->page_title . PHP_EOL;

to

echo strip_tags(KissMT::init()->page_title) . PHP_EOL;

but the tags are still there. I tried also to change the strip_tags to htmlspecialchars and it works as expected so I'm on the right place...

 

You can have a look at the page here:

http://www.atelierdascores.com/bespecial-natalb-c-78.html

Share this post


Link to post
Share on other sites

Hi Robert,

 

I noticed something strange. I have 2 categories with HTML tags in their name, to put some emphasis on the categories list, but when I go the the category page, I see the tags written there as text.

 

Yes it is correct behaviour .. product names should not have html elements/tags and if they do they should be protected with htmlspecialchars() which removes the html meaning of the characters.

Share this post


Link to post
Share on other sites

Yes it is correct behaviour .. product names should not have html elements/tags and if they do they should be protected with htmlspecialchars() which removes the html meaning of the characters.

In my case the html tag is to highlight the category, but I need to remove it from the page, but using htmlspecialchars() does not do that as it transforms the < and > into &lt and &gt.

How can I fix this? You are already fixing this when writing the category name in the head section...

Edited by modem2.0

Share this post


Link to post
Share on other sites

Use strip_tags().

 

Regards

Jim

I know, but it doesn't work. On current online version has the following code:

		    <?php
			  // KissMT start
			  echo strip_tags(KissMT::init()->page_title) . PHP_EOL;
			  // KissMT end
		    ?>

in 3 places but the tags are still there.

Share this post


Link to post
Share on other sites

Fixed.

Kiss_MT was returning the title using htmlspecialchars(), so writing &lt and &gt in the source code. So I changed to :

echo strip_tags(htmlspecialchars_decode(KissMT::init()->page_title)) . PHP_EOL;

Share this post


Link to post
Share on other sites

Hi,

 

I am getting the errors when i click admin / categories and admin/manufactures, can someone please help?

 

Fatal error: require_once() [function.require]: Failed opening required 'includes/modules/kiss_meta_tags/classes/kiss_meta_tags_class.php' in admin/manufactureres.php on line 15

 

Fatal error: require_once() [function.require]: Failed opening required 'includes/modules/kiss_meta_tags/classes/kiss_meta_tags_class.php' in admin/categories.php on line 15

 

thanks in advance

 

Lyn

Share this post


Link to post
Share on other sites

Hi Robert,

 

Firstly, many thanks for your excellent contributions.

 

I am having a bit of trouble with the KissMT cache and hope you can point me in the right direction.

 

I have the contrib installed and it works - generating meta tags. However when I switch on the cache I get no meta tags on the page. The cache files are created but all have a size of 0 and are empty.

 

I have switched the whole thing on and off, reset the cache, checked the file permissions - all to no avail.

 

The site is www.granddadrobdesigns.co.uk

 

Currently KissMT is on with the cache off - as this was the only way I could get it to work.

 

Any help would be gratefully received.

 

Many thanks

 

Dom

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

×