Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Problem with nofollow tag

Quote Reply
Problem with nofollow tag
I added a new field to the links table, "noFollow", which is an Enum with "Yes" and "No" as the possible values. I added it to the validate form so that the reviewer can select to add a nofollow tag to links if they choose. I'm having trouble getting the build function to add the nofollow tags to the links. Here's the link template I'm using:

Code:
<%if noFollow eg 'No'%>
<li><strong><a href="<%URL%>"><%Title%></a></strong>
<%elseif noFollow eg 'Yes'%>
<li><strong><a href="<%URL%>" rel="nofollow"><%Title%></a></strong>
<%endif%>

Whichever I put first in the "if" loop is the one that get's built. ie, if I reverse the order of the above, all links get the nofollow tag.

An ideas?

Thanks.
Quote Reply
Re: [Spacemanspiff] Problem with nofollow tag In reply to
Hi,

Don't know if this has anything to do with it but I see your using eg for equal instead of eq.
Quote Reply
Re: [Spacemanspiff] Problem with nofollow tag In reply to
Hi,

Below should work



Code:
<%if noFollow eq 'No'%>
<li><strong><a href="<%URL%>"><%Title%></a></strong>
<%elseif noFollow eq 'Yes'%>
<li><strong><a href="<%URL%>" rel="nofollow"><%Title%></a></strong>
<%endif%>


Cheers,

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [tandat] Problem with nofollow tag In reply to
So it was eq instead of eg!
Quote Reply
Re: [Spacemanspiff] Problem with nofollow tag In reply to
Or just simplify it to:
Code:
<li><strong><a href="<%URL%>"<%if noFollow eq Yes%> rel="nofollow"<%endif%>><%Title%></a></strong>
and don't forget to close your li tag.

Edit: oops, removed extra endif tag.

Adrian

Last edited by:

brewt: Sep 10, 2007, 8:00 AM
Quote Reply
Re: [brewt] Problem with nofollow tag In reply to
That did the trick Brewt. Had to remove the last endif tag but it worked like a charm.

Thanks