Gossamer Forum
Home : Products : Links 2.0 : Discussions :

else in Templates?

Quote Reply
else in Templates?
Hi

First off I'm sorry for posting this here, I know that I've seen the answer somewhere and didn't take much notice of it, but now I want to use it can I find it? Nope.

Is it possible to do if-else statements in the templates (I'm sure that I've seen it is) and if so what format should they be in? I've gone through the faq's, resources, readme, searched these boards and can't find it. Frown

Thanks for your time.

Cheers


------------------
Col
Quote Reply
Re: else in Templates? In reply to
Yea...Download the Enhanced Template.pm file and it will allow you to use if and else.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: else in Templates? In reply to
Hi Eliot

Thanks for that, I've installed the enhanced Template.pm. Is there anywhere that lists the format of the if else command?

I've tried:

<%if variable%>
<%else%>
<%endif%>

and

<%if variable%>
<%ifelse%>
<%endif%>

I'm sure I'm missing the obvious but maybe someone could point it out Smile

Cheers


------------------
Col
Quote Reply
Re: else in Templates? In reply to
  
Code:
<%ifnot variable%>
text
<%endif%>

AND

Code:
<%if variable eq 'string'%>
text
<%endif%>

Change variable with the field name in your links.def file. Change 'string' with the value of your field in the links.def file.

You can also simply use the following codes to replace the if variable codes above:

Code:
<%if variable%>
text
<%endif%>

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------




[This message has been edited by Eliot (edited December 30, 1999).]
Quote Reply
Re: else in Templates? In reply to
DOH!
Thanks. I was reading it but it wasn't sinking in because I was expecting to see an 'else' in there somewhere.

All working now.
Again thanks.


------------------
Col
Quote Reply
Re: else in Templates? In reply to
I try to use Enhanced Template.pm and try to use is like that:
<%if ID > 600%>
Text
<%endif%>

But don't work :(

Please help me.

Quote Reply
Re: else in Templates? In reply to
Try using:

Code:

<%if ID gt 600%>
TEXT
<%endif%>


gt = greater than
lt = less than

Regards,

Eliot Lee