Jump to:

3393 Posts in 976 Topics by 852 members

Template Questions

SilverStripe Forums » Template Questions » Multi Column Menu : how to?

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

Page: 1
Go to End
Author Topic: 450 Views
  • pinkp
    Avatar
    Community Member
    168 Posts

    Multi Column Menu : how to? Link to this post

    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

  • kaanuni
    Avatar
    Community Member
    22 Posts

    Re: Multi Column Menu : how to? Link to this post

    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

  • pinkp
    Avatar
    Community Member
    168 Posts

    Re: Multi Column Menu : how to? Link to this post

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

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