Possible to set entire blocks to nofollow?

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by calshei1-gdo on April 7, 2009 at 7:09pm

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?

Comments

tagadelic nofollow

Posted by Z2222 on April 8, 2009 at 12:32am

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

Search Engine Optimization (SEO)

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /