2864 Posts in 732 Topics by 700 members
Template Questions
SilverStripe Forums » Template Questions » if-condition throws syntax error
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba
|
Page:
1
|
Go to End | |
| Author | Topic: | 1485 Views |
-
if-condition throws syntax error

2 July 2009 at 8:32pm
Hi!
I always get following error and cannot figure out what is wrong:
Parse error: syntax error, unexpected '}' in ....\...MagazinViewSingle.ss on line 41
Template
<div class="item $Item.ClassName">
<% if Item.ClassName == ArticleDataObject %>
<H2>$Item.Title</H2>
<p>$Item.Text</p>
<% else %>
Content Type is not configured in MagazinViewSingle.ss
<% end_if %>
</div>Any ideas or hints?
Thanks
Greetz from Germany,
Malte
-
Re: if-condition throws syntax error

2 July 2009 at 9:54pm
<% if Item.ClassName == ArticleDataObject %>
should be :
<% if Item.ClassName = ArticleDataObject %>
-
Re: if-condition throws syntax error

2 July 2009 at 10:01pm
Hi lemon8,
The same error still occures..
The output of Item.ClassName works pretty well.
By the way "Item" is a record...Cheers,
Malte
-
Re: if-condition throws syntax error

2 July 2009 at 10:58pm
I suggest you do the following:
<% control Item %>
<div class="item $ClassName">
<% if ClassName = ArticleDataObject %>
<h2>$Title</h2>
<p>$Text</p>
<% else %>
Content Type is not configured in MagazinViewSingle.ss
<% end_if %>
</div>
<% end_control %> -
Re: if-condition throws syntax error

2 July 2009 at 11:24pm
Hi banal,
thanks for your reply.
It's working...
| 1485 Views | ||
|
Page:
1
|
Go to Top |



