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

    I am using wayfinder for a menu in my site - and am using CSS to deliver the relevant background images.

    Only one section of the site currently has a sub menu - and at the moment only one sub page exists - and I am displaying that sub page in the menu like so:

    + Home
    + About Us
    - History
    + Portfolio
    + Contact Us
    etc

    In my testing, if there is only one sub menu item, wayfinder does not include the [+wf.classes+] for the sub menu - so the correct background image is not shown (eg the css breaks).

    However, if there are 2 or more sub menu items it does - and the menu looks as intended (as controlled by the css).

    I need [+wf.classes+] inserted even when only one sub menu item exists.

    Anyone know how to do this?

    I’d like to avoid having to change the css everytime I add / remove a sub menu item.

    My way finder call is as follows:
    [[Wayfinder? 
    &startId=`0` 
    &level=`0` 
    
    &outerTpl=`menu-sub_outer` 
    &rowTpl=`menu-sub_outer-row` 
    &innerTpl=`menu-sub_inner` 
    &innerRowTpl=`menu-sub_inner-row` 
    
    &titleOfLinks=`menutitle` 
    &excludeDocs=`5,12,13,3,4,2,19`]]



    the &innerTpl=`menu-sub_inner` is as follows:
    <li[+wf.classes+]><a href="[+wf.link+]" title="[+wf.title+]"><span>[+wf.linktext+]</span></a></li>



    I need something like this, with class="last" added even when only one sub menu page exists:

    <div id="nav">
     <ul>
      <li><a href="#"><span>Home</span></a></li>
      <li class="active"><a href="#"><span>About Us</span></a>
       <ul>
        <li class="last"><a href="#"><span>History</span></a></li>
       </ul>
      </li>
      <li><a href="#"><span>Portfolio</span></a></li>
    etc
     </ul>
    </div>



    Thanks in advance.
      Web design Adelaide
      http://gocreate.com.au
      • 16183
      • 1,390 Posts
      Quote from: nickf08 at Jun 22, 2009, 08:02 AM

      I need something like this, with class="last" added even when only one sub menu page exists:

      Hi Nick,

      That’s been implemented in Wayfinder 2.5 Beta:

      http://modxcms.com/forums/index.php/topic,33904.0.html

      &lastClass is assigned correctly when only one menu item - Julian Warren

      cheers/k
        • 21417
        • 486 Posts
        Great stuff - thanks Kongondo.

        I might way until its a stable release (outside of beta) but great to know its coming.

        Many thanks.
          Web design Adelaide
          http://gocreate.com.au
          • 4310
          • 2,310 Posts
          I hacked the main file to remedy the situation see this thread.
            • 21417
            • 486 Posts
            SENSATIONAL!!!!

            Thank you kindly Bunk58 - that works perfectly!!!

            The support in the MODx community is amazing - how could you ever use another cms with support like this.

            Thanks again.
              Web design Adelaide
              http://gocreate.com.au