17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 2035 Views |
-
Simple Logic in Templates (Greater Than / Less Than)

1 August 2008 at 5:11am
Hi,
Can I compare two integers in a template? Want to check the position in a control Children loop. I.e.: <% if(Pos < 6) %>. That kind of thing. I can get away with <% if(Pos = 6) %> but the greater than and less than breaks it. How can I compare? Can't find syntax for this anywhere.
Thanks,
Garrett -
Re: Simple Logic in Templates (Greater Than / Less Than)

1 August 2008 at 7:19am
Hi Garrett-
There's no support (yet, anyway) for greater/less than comparisons, but you could try checking the position with the $Pos variable in the template.
http://doc.silverstripe.com/doku.php?id=built-in-page-controls#dataobjectset_options
John
| 2035 Views | ||
|
Page:
1
|
Go to Top |


