NARKOZ you can try
<% if InSection(forum) || InSection(blog) %>
If that doesn't work you'll need to move the logic to your PHP page controller.
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
NARKOZ you can try
<% if InSection(forum) || InSection(blog) %>
If that doesn't work you'll need to move the logic to your PHP page controller.
to move the logic to your PHP page controller
Can you give me any documentation about this?
Well its just writing pretty much the same thing, just in PHP rather than the template and passing a simple boolean answer.
In your mysite/code/Page.php, in either your controller or the model (both should work)
function HasSidebar() {
return ($this->InSection('blog') || $this->InSection('forum'));
}
Then in the template you use <% if HasSidebar %>....
Thanks. It works.