Jump to:

3393 Posts in 976 Topics by 852 members

Template Questions

SilverStripe Forums » Template Questions » Control next item in menu loop

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

Page: 1
Go to End
Author Topic: 1106 Views
  • kylehudson00
    Avatar
    Community Member
    22 Posts

    Control next item in menu loop Link to this post

    Hi all! Another, probably blindingly obvious, question from yours truly. Within each iteration of Menu control, I would like to be able to check whether the *next* item in the loop has a LinkingMode of either 'current' or 'section'. The reason being, I need to apply an additional css class to the menu item directly before the current/section item. Is there a built-in page control I can use to accomplish this, or do I need to write some custom code? Any advice would be most appreciated!!!

    Cheers,
    Kyle.

  • kylehudson00
    Avatar
    Community Member
    22 Posts

    Re: Control next item in menu loop Link to this post

    Given the lack of response, I figure there isn't a built in page control to handle something like this - so I went ahead and just wrote a couple of simple functions to take care of it. Works great. Thanks anyway !

    1106 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.