Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

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.

Template Questions /

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

Control next item in menu loop


Go to End


2 Posts   1796 Views

Avatar
kylehudson00

Community Member, 22 Posts

1 May 2011 at 8:51pm

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.

Avatar
kylehudson00

Community Member, 22 Posts

4 May 2011 at 5:33pm

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 !:)