17452 Posts in 4473 Topics by 1971 members
|Go to End|
29 June 2007 at 5:48pm
'If blocks' documentation referred to: http://doc.silverstripe.com/doku.php?id=templates#if_blocks
It says in the documentation that currently negations such as x != 3 are not available. Does this mean that tests such as x == 3 are available?
Is it testing only on the presence of the particular property?
Can you test subproperty elements: eg. <% if $LinkingMode.current %> (stuff goes here) <% end_if %> ?
Things are looking up!
Google Summer of Code Hacker
30 June 2007 at 4:36am Last edited: 30 June 2007 4:37am
> Does this mean that tests such as x == 3 are available?
Yes, but for some reason, the comparison use a single = sign. Example here:
> Can you test subproperty elements: eg. <% if $LinkingMode.current %> (stuff goes here) <% end_if %> ?
You should be able test anything that can be accessed. I think syntax you want is <% if LinkingMode = current %>
<% control Menu(1) %>
<li><a href="$Link" title="Go to the $Title.XML page" class="$LinkingMode"><span>$MenuTitle.</span></a>
<% if LinkingMode = current %>
This is the current page
<% end_if %>
<% end_control %>
For similar examples see:
> Things are looking up!
Great! I hope things continue to go well for you.
Have a good weekend,
|Go to Top|