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
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
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
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