21306 Posts in 5736 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 774 Views |
-
Multiple if statements in template

2 December 2010 at 2:36pm
My template code gives an error. The problem is that I have multiple conditionals in the template.
<% if Row3Heading || Row3Image || Row3Content || Row3LinkText %>
<div class="bottomColumn">
<% if Row3Heading %>
<h1>$Row3Heading.Parse(NiceXHTML)</h1>
<% end_if %><% if Row3Image %>
<p class="shadow"><% if Row3LinkURL %><a href="$Row3LinkURL.ATT"><% end_if %><img src="<% control Row3Image %>$SetWidth(250).Link<% end_control %>" alt="" title="" /><% if Row3LinkURL %></a><% end_if %></p>
<% end_if %><% if Row3Content %>
<p class="text">$Row3Content.Parse(NiceXHTML)</p>
<% end_if %><% if Row3LinkURL && Row3LinkText %>
<h2><a href="$Row3LinkURL.ATT">$Row3LinkText.Parse(NiceXHTML)</a></h2>
<% end_if %>
</div>
<% end_if %>How can I use more than one set of || in the template?
-
Re: Multiple if statements in template

2 December 2010 at 3:34pm
Template engine doesn't support that level of checking. You'll have to write that logic in your PHP code
function ShowBottomColumn() {
return ($this->Row3Heading || $this->Row3Image || $this->Row3Content || $this->Row3LinkText);
}Then just use <% if ShowBottomColumn %>
| 774 Views | ||
|
Page:
1
|
Go to Top |


