3212 Posts in 847 Topics by 809 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 956 Views |
-
Nesting an IF in a control

22 February 2009 at 1:10pm
Is it possible to use a conditional if to check a date, such as:
<% control Children %>
<% if EventDate > Now %>
<li>$Title</li>
<% end_if %>
<% end_control %>Embargo/Expiry doesn't seem to limit my list of events (even logged out), so I need to filter them another way.
-
Re: Nesting an IF in a control

23 February 2009 at 2:07pm
the template parser is basic, you can't do comparisons between 2 variables. You will have to add a function to your Event then check on that
function ShowEvent() {
return ($this->EventDate > date('Y-m-d')) ? true : false;
}then in your template use <% if ShowEvent %>
| 956 Views | ||
|
Page:
1
|
Go to Top |

