We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9255
    • 41 Posts
    Is there a way to split wayfinder into 2 lists? I am trying to create a menu that looks like this....

    link 1 link 2
    link 3 link 4
    link 5 link 6

    I am new to modx so any help you can give me the better. In ASP I can do a position() and use it on a mod function and get evens and odds, is there a way to do that in modx? I am trying to learn about the templating of the wayfinder right now so I can get the whole thing laid out but if you have any tips on that, it would be much appreciated.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      That particular structure is easy; it can all be done with CSS. Just make the outer <div> container small enough so that only two items (themselves sized by CSS) will fit; the rest will drop below, two by two.

      The harder part is when you want something like

      1 5
      2 5
      3 7
      4 8
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 9255
        • 41 Posts
        Exactly what do you mean by doing it with CSS, can you give me a quick example?
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Use a plain Wayfinder call to generate a simple unordered list. Have the snippet call inside of <div id="menu">...</div> tags.
          #menu {width: 100px;}
          #menu a {display: block; float: left; width: 50px;}

          As you can see, there will only be room in the <div> for two <a> elements. The rest will drop down; again there is only room for two, and again the rest will drop down.

          This is basic CSS box model manipulation.

          Of course, the widths will have to be adjusted to account for any desired margins or padding.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 16183
            • 1,390 Posts
            Further reading if you wish...

            http://www.alistapart.com/articles/multicolumnlists

            cheers/k