Possible to set entire blocks to nofollow?

calshei1-gdo's picture

Is it possible to set an entire block region to "nofollow" for the purpose of pagerank sculpting? For example, take the use of a tagadelic tag cloud block on a website. If I wanted all those links to be nofollow automatically, how would I do that?

Login to post comments

tagadelic nofollow

J. Cohen's picture
J. Cohen - Wed, 2009-04-08 00:32

To add nofollow to tagadelic you could probably override the theme functions in template.php.

For example, copy these lines from tagadelic.module:

function theme_tagadelic_weighted($terms) {
  $output = '';
  foreach ($terms as $term) {
    $output .= l($term->name, taxonomy_term_path($term), array('attributes' => array('class' => "tagadelic level$term->weight", 'rel' => 'tag'))) ." \n";
  }
  return $output;
}

And put them in your template.php with two modifications -- the function name was changed to match the name of the theme (e.g., "bluemarine"), and "nofollow" was added to the rel attribute:

function bluemarine_tagadelic_weighted($terms) {
  $output = '';
  foreach ($terms as $term) {
    $output .= l($term->name, taxonomy_term_path($term), array('attributes' => array('class' => "tagadelic level$term->weight", 'rel' => 'tag nofollow'))) ." \n";
  }
  return $output;
}

I haven't tested it, but something like that should work.

--
My Drupal Tutorials