Having followed all of the tutorials, I decided to modify the ArticleHolder type so that it could have ArticleHolder children, which in turn would have ArticlePage children. I changed the $allowed_children setting without a problem, however I get a parse error with my modified ArticleHolder.ss, which checks if the children are ArticleHolders or Article Pages and only uses the required fields.
This is my /themes/tutorial/templates/Layout/ArticleHolder.ss:
<div id="Content" class="typography">
$Content
<ul id="NewsList">
<% if this->Child()->ClassName = ArticlePage %>
<% control Children %>
<li class="newsDateTitle"><a href="$Link" title="Read more on $Title">$Title</a></li>
<li class="newsDateTitle">$Date.Nice, $Qualification</li>
<li class="newsSummary">$Description <a href="$Link" title="Read more on $Title">Read more >></a></li>
<% end_control %>
<% else %>
<% control Children %>
<li class="newsDateTitle"><a href="$Link" title="Read more about $Title">$Title</a></li>
<li class="newsDateTitle">$Qualification</li>
<li class="newsSummary">$Description <a href="$Link" title="Read more about $Title">Read more >></a></li>
<% end_control %>
<% end_if %>
</ul>
</div>
and this is the error I get:
Parse error: syntax error, unexpected '}' in /tmp/silverstripe-cache-home-irevise-public_html/.cache.home.irevise.public_html.themes.tutorial.templates.Layout.ArticleHolder.ss on line 58
I've searched through ArticleHolder.ss, and can't find any out-of-place braces. Can anybody tell me what's going wrong here?