We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16364
    • 13 Posts
    Can anyone help me to get this kind of menu work with wayfinder?
    Demo: http://phoenity.com/newtedge/horizontal_nav/ (inline version)


    This is a demonstration of a horizontal navigation list or menu, which pops up a vertical drop-down menu when hovered.

    The HTML codes are very simple, as follows:

    <ul class="nav">
    <li><strong>a navigation item</strong>
    <ul>
    <li>a navigation list item</li>
    <li>...</li>
    <li>...</li>
    <li>...</li>
    </ul>
    </li>
    <li><strong>a navigation item</strong>
    <ul>
    <li>another navigation list item</li>
    <li>...</li>
    <li>...</li>
    <li>...</li>
    </ul>
    </li>
    <li>...</li>
    ...
    </ul>


    The ul tag is assigned with the class of nav. That’s the only class needed to be refered from the style sheet. The CSS codes are shown below, with comments:

    /*** Nav bar styles ***/

    ul.nav,
    .nav ul{
    /*Remove all spacings from the list items*/
    margin: 0;
    padding: 0;
    cursor: default;
    list-style-type: none;
    display: inline;
    }

    ul.nav{
    display: table;
    }
    ul.nav>li{
    display: table-cell;
    position: relative;
    padding: 2px 6px;
    }


    ul.nav>li:hover{
    padding-right: 1px;
    } [*]

    ul.nav li>ul{
    /*Make the sub list items invisible*/
    display: none;
    position: absolute;
    max-width: 40ex;
    margin-left: -6px;
    margin-top: 2px;
    }

    ul.nav li:hover>ul{
    /*When hovered, make them appear*/
    display : block;
    }

    .nav ul li a{
    /*Make the hyperlinks as a block element, sort of a hover effect*/
    display: block;
    padding: 2px 10px;
    }

    /*** Menu colors (customizable) ***/

    ul.nav,
    .nav ul,
    .nav ul li a{
    background-color: #fff;
    color: #369;
    }


    ul.nav li:hover,
    .nav ul li a:hover{
    background-color: #369;
    color: #fff;
    }

    ul.nav li:active,
    .nav ul li a:active{
    background-color: #036;
    color: #fff;
    }

    ul.nav,
    .nav ul{
    border: 1px solid #369;
    }

    .nav a{
    text-decoration: none;
    }
      • 26931
      • 2,314 Posts
      hi there,

      sure, have a look here at some wayfinder examples: http://www.muddydogpaws.com/development/wayfinder/examples.html

      there are some preconfigured wayfinder-menus which are basically easy plug’n play menus that come with the standard modx-installation, you’ll find them in assets -> snippets -> wayfinder -> configs
      you would call those preconfigured menus like this: [!Wayfinder?startId=`0` &config=`configname`!]

      in this thread can download some nice wayfinder-menus: http://modxcms.com/forums/index.php/topic,31376.msg190237.html#msg190237

      on the other hand, you could easily build, one by yourself

      cheers, j