Gossamer Forum
Home : Products : Links 2.0 : Installation -- Unix :

Enhanced Template Support

Quote Reply
Enhanced Template Support
I'm attempting to set-up this mod, but I'm apparently doing something wrong...

I want to use this mod to change the text written by the link.html template. If a link has 0 votes for a rating, I wish to write different text than if there is at least 1 vote. The code I'm using is:

<%if Votes eq '0'%>
<small class="date">(Added: <Úte%> Hits: <%Hits%> Rating: <%Rating%> Votes: <%Votes%>) <a href="<Û_cgi_url%>/review.cgi?ID=<%ID%>">Rate it!</a></small>
<%endif%>

<%if Votes gt '0'%>
<small class="date">(Added: <Úte%> Hits: <%Hits%> Rating: <%Rating%> Votes: <%Votes%>) <a href="<Û_cgi_url%>/review.cgi?ID=<%ID%>">Rating and Review</a></small>
<%endif%>

I've tried several variations of this, no success. The end result is no Rating text written to the page.

Would appreciate some assist.

TKS

Ron

Quote Reply
Re: Enhanced Template Support In reply to
1) This type of question (any related to Mods or add-ons) should be posted in the Links 2.0 Customization Forum in the future.

2) For numerical values, it is better to use > (greater than), < (less than), and = (equals).

So, try changing your codes to the following:

Code:

< %if Votes = 0%>
<small class="date">(Added: < %Hits% > Hits: < %Hits% > Rating: < %Rating% > Votes: < %Votes% >) <a href="< Û_cgi_url %>/review.cgi?ID=< %ID% >">Rate it!</a></small>
<%endif%>
< %if Votes > 0% >
<small class="date">(Added: < %Hits% > Hits: < %Hits% > Rating: < %Rating% > Votes: < %Votes% >) <a href="< Û_cgi_url% >/review.cgi?ID=< %ID >">Rating and Review</a></small>
< %endif% >


Remove all spaces before and after the hash marks (%).

Regards,


Eliot Lee
Quote Reply
Re: Enhanced Template Support In reply to
Thanks Elliot, and my apologies for using the wrong forum. But the code you provided still doesn't work - same results of nothing being written to the page. I was careful to remove all spaces before and after the hash.

Is there a sure way of testing to verify if the parser subroutine was added correctly?

Quote Reply
Re: Enhanced Template Support In reply to
Nope...other than making sure that you REPLACED the COMPLETE sub parse in the Template.pm module with the CODES provided in the MODIFICATION instruction page.

Regards,

Eliot Lee