Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Template Questions /

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba

Can <% if %> Use Integers?


Go to End
Reply


2 Posts   524 Views

Avatar
BobRock

Community Member, 15 Posts

5 September 2013 at 1:56am

Edited: 05/09/2013 1:56am

I'd like to use a template conditional based on an integer return like this:

 <% if $Variable.count = 1 %> 

Is that possible? It doesn't seem to work when I try it and the documentation talks only about literals inside "" with ==.

Bob

Avatar
BobRock

Community Member, 15 Posts

5 September 2013 at 6:13am

Edited: 05/09/2013 6:13am

With some help from Stack Overflow, the answer is yes, but you have to do it right:

 <% if $Variable.count == 1 %> 

Note that that's two =.

Bob