We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17885
    • 10 Posts
    Hi,

    How to split wayfinder links into 2 positions(left and right)? For example I have 8 links, so I want to display 1st-4th link in the left and 5th-8th in the right like below:

    <div class="main_nav left">
    <ul>
    <li class="first active"><a href="#">Link 1</a></li>
    <li><a href="#">Link 2</a></li>
    <li><a href="#">Link 3</a></li>
    <li class="last"><a href="#">Link 4</a></li>
    </ul>
    </div>
    <div class="main_nav right">
    <ul>
    <li><a href="#">Link 5</a></li>
    <li><a href="#">Link 6</a></li>
    <li><a href="#">Link 7</a></li>
    <li class="last"><a href="#">Link 8</a></li>
    </ul>
    </div>


    Can anyone help me please???

    Sorry my english not good.

    Thx
      • 19369
      • 1,098 Posts
      How is the structure of the site? I mean the Tree Menu on the left in the Manager
        • 19369
        • 1,098 Posts
        The first solution that comes to my mind is this:

        Menu tree:
        Home (1)
        Item2 (2)
        Item3 (3)
        Item4 (4)
        Item5 (5)
        Item6 (6)
        Item7 (7)
        Item8 (8)


        Wayfinder Call:
        <div class="sidebar-left">
        [[Wayfinder? &startId=`0` &excludeDocs=`1,2,3,4`]]
        </div>
        
        <div class="sidebar-right">
        [[Wayfinder? &startId=`0` &excludeDocs=`5,6,7,8`]]
        </div>
          • 17885
          • 10 Posts
          Hi Microchip,

          Thank you very munch for the solution. Sorry that I didn’t explain it more specific.
          Yes..the menu tree is exactly like what you mean. But what about if the links only 5 or 6 links? So basically I want to split the link automatically into 2 positions with the same number of link for each position.

          For Example:

          1. 5 links:
          <div class="main_nav left">
          <ul>
          <li class="first active"><a href="#">Link 1</a></li>
          <li><a href="#">Link 2</a></li>
          <li class="last"><a href="#">Link 3</a></li>
          </ul>
          </div>
          <div class="main_nav right">
          <ul>
          <li><a href="#">Link 4</a></li>
          <li class="last"><a href="#">Link 5</a></li>
          </ul>
          </div>

          2. 6 links
          <div class="main_nav left">
          <ul>
          <li class="first active"><a href="#">Link 1</a></li>
          <li><a href="#">Link 2</a></li>
          <li class="last"><a href="#">Link 3</a></li>
          </ul>
          </div>
          <div class="main_nav right">
          <ul>
          <li><a href="#">Link 4</a></li>
          <li><a href="#">Link 5</a></li>
          <li class="last"><a href="#">Link 6</a></li>
          </ul>
          </div>

          Once again thank you for your great help.


          Regards,
          Made
            • 19369
            • 1,098 Posts
            With the solution above the links can be 5, 6, or 20, it doesn’t matter. Just exlude the docs you don’t want to show with the &excludeDocs parameter. Btw, if they have such a specific number how can you do it automatically? Maybe if you explain me better I can find another solution.


            <div class="sidebar-left">
            [[Wayfinder? &startId=`0` &excludeDocs=`1,2,3,4`]]
            </div>
            
            <div class="sidebar-right">
            [[Wayfinder? &startId=`0` &excludeDocs=`5,6,7`]]
            </div>
              • 17885
              • 10 Posts
              Yes...Your solutions above is great and working for me. But the problem is that I don’t know how many links will be created by the editor(doesn’t know anything about HTML, CSS, etc) and the editor doesn’t need to edit the template every-time he/she create a new page/link. So I need to create a template that automatically split into 2 positions.


              Regards,
              Made

                • 19369
                • 1,098 Posts
                Is not possible to change the website structure? Like this:

                Container (1)
                   Item1 (2)
                   Item2 (3)
                   Item3 (4)
                Container (5)
                   Item4 (6)
                   Item5 (7)
                   Item6 (8)
                
                  • 17885
                  • 10 Posts
                  I’m afraid I can not change the structure, otherwise the editor will confuse to add new page/link and he/she will keep asking me. embarrassed
                    • 19369
                    • 1,098 Posts
                    But the user has to choose at least if the page goes in the menu on the right or in the menu on the left, right? So in the manager you could add a Dropdown Template Variable with two choices: Menu Left; Menu Right.

                    Than I think you could use Ditto and the filter parameter to generate the menu accordingly.