I've run into a confusing issue with template syntax, maybe somebody can help me out. The following two snippets seem like they should be equivalent, but apparently they're not. There must be a reason why, but I have no idea what it could be. Any thoughts?
In a template, this works:
<% control Parent %> <% if URLSegment == home %> <p>foo</p> <% end_if %> <% end_control %>
But this does not:
<% if Parent.URLSegment == home %> <p>foo</p> <% end_if %>
The second example returns a blank page and logs this error:
"PHP Parse error: syntax error, unexpected '}' in /private/var/folders/HJ/HJPYl5CrFjSn7+gK6JPhl2pKtAE/-Tmp-/silverstripe-cache-Applications-MAMP-htdocs/.cache.Applications.MAMP.htdocs.themes.mytheme.templates.Page.ss on line 264"