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.

Template Questions /

Multi Column Menu : how to?


Reply


3 Posts   606 Views

Avatar
pinkp

Community Member, 168 Posts

12 January 2013 at 3:22am

Doesn't any one have a good way to create a menu which splits in to columns?
Ie. 9 links in a set of 3 columns...

I don't think it can be achieved with CSS alone?
Might need some code to maybe split it up after every 3 and place in a new div? Any ideas?

Thanks PP

Avatar
kaanuni

Community Member, 22 Posts

13 January 2013 at 1:33am

Edited: 13/01/2013 1:36am

Well i do exactly that in a responsive site, when the screen width goes below a certain threshold. I just set the width of my left floated <li>'s to 33.33%. But in ss3 you could also use the template conditional <%if MultipleOf(3)%><% end_if %> within your loop to the same effect. Look here:

http://doc.silverstripe.com/framework/en/3.1/reference/templates#modulus-and-multipleof

Avatar
pinkp

Community Member, 168 Posts

13 January 2013 at 11:32am

Great! Float the li left! OK that was a lot easier than I thought... thanks