nofollow for comment links

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
jaal
Regular
Posts: 63
Joined: Thu Oct 26, 2006 2:48 pm
Location: Guetersloh, Germany
Contact:

nofollow for comment links

Post by jaal »

Hi all,

I've searched my way through the forum and google, but didn't found a hint.

How can I activate "nofollow" for links in comments? Do I have to hardcode them or is there any option or plugin available?

Thanks
Jan
Don Chambers
Regular
Posts: 3659
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

I am unaware of any plugin that does this, but it is quite simple to do. Your template needs a comments.tpl file. If it does not have one, copy the file from /templates/default/ to your template folder. Edit the file and look for something like this:

Code: Select all

(<a class="comment_source_url" href="{$comment.url}" title="{$comment.url|@escape}">{$CONST.HOMEPAGE}</a>)
and modify it to be this:

Code: Select all

(<a class="comment_source_url" href="{$comment.url}" title="{$comment.url|@escape}" rel="nofollow">{$CONST.HOMEPAGE}</a>)
=Don=
jaal
Regular
Posts: 63
Joined: Thu Oct 26, 2006 2:48 pm
Location: Guetersloh, Germany
Contact:

Post by jaal »

Thanks for your help.

I don't really like the idea of editing more than necessary templates. If there is any update on them the custom ones won't get the update.

But in this case nofollow is more important to me ;)

Thanks
Jan
Don Chambers
Regular
Posts: 3659
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

If the template already has a custom comments.tpl, and an increasing number of templates do, it is no big deal. Also - the probability that the default comments.tpl will be modified is probably low.
=Don=
Post Reply