Hi, is it possible to add rel="nofollow" to the similar entry links created?

Thanks for any help.

Comments

Jboo’s picture

Does anyone know if this is possible?

Thanks.

deekayen’s picture

Title: Adding rel="nofollow" to similar entries » Add rel="nofollow" option for similar links
Version: 4.7.x-1.x-dev » master
Category: support » feature

If you don't want to wait for me to get it in the official version, make the following (untested) changes to the bottom of your similar.module file:

from:

      $items[] = l('<div class="similar-title">'. $node->title .'</div><div class="simlar-teaser">'. check_markup($node->teaser) .'</div>', 'node/'.$node->nid, NULL, NULL, NULL, NULL, true);
    } else {
      $items[] = l($node->title, 'node/'.$node->nid);

to:

      $items[] = l('<div class="similar-title">'. $node->title .'</div><div class="simlar-teaser">'. check_markup($node->teaser) .'</div>', 'node/'.$node->nid, array('rel' => 'nofollow'), NULL, NULL, NULL, true);
    } else {
      $items[] = l($node->title, 'node/'.$node->nid, array('rel' => 'nofollow'));

I'd throw it in CVS now, but would rather make a nice checkbox option for toggling it on/off somewhere.

Jboo’s picture

Thanks for your help, works great.

deekayen’s picture

Status: Active » Fixed

Added as block option in CVS revision 1.7.2.1.

Anonymous’s picture

Status: Fixed » Closed (fixed)