Jump to:

3443 Posts in 1030 Topics by 871 members

Template Questions

SilverStripe Forums » Template Questions » LinkOrSection failing for one page

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 494 Views
  • Lazarus404
    Avatar
    Community Member
    71 Posts

    LinkOrSection failing for one page Link to this post

    Hi all,

    I have a site built with six top level pages. Each page uses a different controller to facilitate different functionality (one page is a Blog module). In the navigation for this page, I'm using LinkOrSection to detect if the page is current so that I can highlight a nav item for that page. The problem I'm getting, however, is that it isn't working for one of these pages. The page is nothing special, but when directed to the page, the LinkOrSection results as link. Is there something I should be checking or looking for in order to figure out why this isn't working?

    Thanks,
    Lee

  • Devlin
    Avatar
    Community Member
    215 Posts

    Re: LinkOrSection failing for one page Link to this post

    The css class 'section' will be parsed only if the current page is a child of the your page.
    Edit: This is wrong. Section should be parsed no matter if or not the actual page is a current one. Sorry.

    You might wanna use $LinkingMode instead. It will return link, current or section.

  • Lazarus404
    Avatar
    Community Member
    71 Posts

    Re: LinkOrSection failing for one page Link to this post

    The page in question is a top level page, which is why it's so odd.

    494 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.