[Zen Cart] How to add rel="nofollow" meta to external store links?

ichthyous

Joined: 2006-06-16
Posts: 324
Posted: Sun, 2007-07-29 16:05

Hi there I currently have the Zen Cart integration module installed and I would like to add a nofollow meta tag to the external product links which the module inserts on each photo page. I want the customer to be able to purchase, but I don't want the search engines indexing those pages. How can I insert the rel="nofollow" tag in the url? Thanks for any help
--Andrew http://andrewprokos.com/photos/new-york/

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Wed, 2007-08-01 14:56

search for "<a" in zencart/includes/templates/template_default/templates/tpl_product_gallery_info_display.php. is that it?

 
ichthyous

Joined: 2006-06-16
Posts: 324
Posted: Wed, 2007-08-01 15:54

There are a few places where <a href is used. I don't think it would be found in the integration module that you upload to zen cart but in the zen cart module for gallery, but I could be wrong.

 
cer

Joined: 2007-08-01
Posts: 19
Posted: Thu, 2007-08-02 10:15

Not quite sure I understand the question. What external product links are inserted other than the links to the gallery images?
The newer versions of Zen Cart handle the obvious noindex, nofollow cases automatically, so a robots.txt file entry may be your easiest option. Something like

Disallow: /index.php?main_page=product_gallery_info

if it is the image links you are referring to.

Rgds,

 
ichthyous

Joined: 2006-06-16
Posts: 324
Posted: Fri, 2007-08-03 14:43

I am referring to the links that the zen cart integration module places on each Gallery photo page so you can checkout through Zen Cart. On my site I have changed the link to read "Purchase a fine art print of this photo"...see here:

http://andrewprokos.com/photos/architecture/guggenheim-nyc-interior/

I want to add a nofollow tag to those links

Thanks!

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Fri, 2007-08-03 15:28

look at function getItemLinks in module.inc
change:

                    array('text' => $this->translate('Purchase Options'),
                            'params' => array('controller' => 'zencart.PurchaseOptions',
                                'itemId' => $item->getId(), 'return' => true));

to:

                    array('text' => $this->translate('Purchase Options'),
                            'attrs' => 'rel="nofollow"',
                            'params' => array('controller' => 'zencart.PurchaseOptions',
                                'itemId' => $item->getId(), 'return' => true));
 
ichthyous

Joined: 2006-06-16
Posts: 324
Posted: Fri, 2007-08-03 19:18

Ok added the code and uploaded the new module.inc file, but for some reason the link is still not showing the nofollow tag. I flushed the template cache and still no change. Is there something I am missing?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Fri, 2007-08-03 20:44

I don't use this module, so I really have no idea what link you're talking about.. just looking in the code for where links are created. Maybe this isn't the right one.. what file did you put "Purchase a fine art print of this photo" in??

 
ichthyous

Joined: 2006-06-16
Posts: 324
Posted: Sat, 2007-08-04 04:57

The module.inc page is correct, but the no follow tag is getting entered in the wrong place. Here is a url from one of the product links:

http://andrewprokos.com/?g2_controller=zencart.PurchaseOptions&g2_attrs=rel%3D%22nofollow%22&g2_itemId=1274&g2_return=%2Fphotos%2Fwashington-dc%2Fus-capitol-spring%2F%3F&&g2_returnName=photo

It's getting embedded in the link url itself for some reason

Thanks

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Sat, 2007-08-04 07:59

Why not use the more straightforward robots.txt way mentioned?

"Disallow: /store/?main_page=product_gallery_info*" in robots.txt will do the job of stopping the product info page from getting indexed.

If you don't want the store to be indexed at all, then use "Disallow: /store*".

Both without the quotation marks as you probably know.

.
Gallery version = 2.2.2
Default theme = PGtheme 1.3.0
Web Site: dakanji.com

 
ichthyous

Joined: 2006-06-16
Posts: 324
Posted: Sat, 2007-08-04 13:28

I don't want to disallow the store's pages from being indexed, just to stop the outbound link on the gallery photo page from being counted.

Thanks

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Sat, 2007-08-04 14:24

Not sure I fully understand. Is it that you don't mind "/store/?main_page=product_gallery_info&xyz&etc" to be indexed as long as the robot doesn't get there by following a link from your gallery?

.
Gallery version = 2.2.2
Default theme = PGtheme 1.3.0
Web Site: dakanji.com

 
ichthyous

Joined: 2006-06-16
Posts: 324
Posted: Sun, 2007-08-05 14:48

Yes, I don't want the spider finding the store page from the gallery page...the problem is that the metas are so similar that it's being seen as two copies of the same page and I am having duplicate content issues. I want to add a nofollow tag to the link so that google will stop finding those store pages. Thanks

Andrew

Andrew Prokos NYC Fine Art Photography

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2007-08-06 05:52

If you got attrs in the URL then it sounds like you put it in the 'params' array instead of in the outer array. if the code is right, then maybe attrs only works with current svn / nightly snapshot.. I don't recall when that was added.

 
ichthyous

Joined: 2006-06-16
Posts: 324
Posted: Mon, 2007-08-06 14:13

Oh I see, yes my version may be getting outdated Thanks