Why is this always on? I am not on this page, and in navigation $LinkingMode always returns positive so it's "selected"
<% if CurrentMember %>
<li class="$LinkingMode"><a href="//www.silverstripe.org/ForumMemberProfile/edit" title="Uredi svoj profil">Uređivanje profila</a></li>
<% end_if %>
We've moved the forum!
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.
The issue for code is that your scope for the $LinkingMode is the page that you're on, so of course it'll always be selected since it's always the page your on. To get it working for that piece of code you'll need to compare the current $URLSegment..
<% if CurrentMember %>
<li class="<% if URLSegment = ForumMemberProfile %>active<% else %>link<% end_if %>"><a href="//www.silverstripe.org/ForumMemberProfile/edit" title="Uredi svoj profil">Uređivanje profila</a></li>
<% end_if %>
Hey Willr,
thank you for your answer, this helps somewhat, but not entirely. It is not correctly showing as link, and not section, when I'm on some other page, but then it also shows link when I am on profile edit page. I don't rly understand why, It should work imo...