We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10529
    • 73 Posts
    Been beating myself up for a couple of days now trying to get this example drop down to work as I need to develop a site with a drop down - Some of it is working but as a vertical menu not horizontal - I have stripped out everything in the template just to focus on the menu see here http://www.gavinbaylis.com/modx/index.php?id=59 am I missing something really obvious like javascript, or have I messed up with the css - although have copied the css from the muddypaws - plus all chunks copied as well.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
     <head>
      <base href="[(site_url)]"></base>
      <title>Learning MODx</title>
      <meta http-equiv="Content-Type" content="text/html; charset=iso-
                                                            8859-1" />
      <link rel="stylesheet" type="text/css" href="assets/templates/wayfinder/style.css" />
     <link rel="stylesheet" type="text/css" href="assets/templates/wayfinder/basic_dd.css" />
    <link rel="stylesheet" type="text/css" href="assets/templates/wayfinder/reset.css" />
     </head>
     <body>
      <div id="banner">
     [[Wayfinder? &startId=`0` &level=`3` &parentClass=`hide` &parentRowTpl=`cssplay_parentRow` &outerTpl=`cssplay_outer` &innerTpl=`cssplay_inner` &rowTpl=`cssplay_row` &outerClass=`menu` &cssTpl=`cssplay_basicdd`]]
      </div>
      <div id="wrapper">
       <div id="container">
        <div id="content">
         <div id="col-1">
    
    <br>


    This is the css

    /* common styling */
    /* set up the overall width of the menu div, the font and the margins */
    
    .menu {
    font-family: arial, sans-serif; 
    width:750px; 
    margin:0; 
    margin:20px 0 60px 0;
    position:relative;
    z-index:100;
    }
    /* remove the bullets and set the margin and padding to zero for the unordered list */
    .menu ul {
    padding:0; 
    margin:0;
    list-style-type: none;
    }
    /* float the list so that the items are in a line and their position relative so that the drop down list will appear in the right place underneath each list item */
    .menu ul li {
    float:left; 
    position:relative;
    }
    /* style the links to be 104px wide by 30px high with a top and right border 1px solid white. Set the background color and the font size. */
    .menu ul li a, .menu ul li a:visited {
    display:block; 
    text-align:center; 
    text-decoration:none; 
    width:106px; 
    height:30px; 
    color:#000; 
    border:1px solid #fff;
    border-width:1px 1px 0 0;
    background:#c9c9a7; 
    line-height:30px; 
    font-size:11px;
    }
    /* make the dropdown ul invisible */
    .menu ul li ul {
    display: none;
    }
    
    /* specific to non IE browsers */
    /* set the background and foreground color of the main menu li on hover */
    .menu ul li:hover a {
    color:#fff; 
    background:#b3ab79;
    }
    /* make the sub menu ul visible and position it beneath the main menu list item */
    .menu ul li:hover ul {
    display:block; 
    position:absolute; 
    top:31px; 
    left:0; 
    width:105px;
    }
    /* style the background and foreground color of the submenu links */
    .menu ul li:hover ul li a {
    display:block; 
    background:#faeec7; 
    color:#000;
    }
    /* style the background and forground colors of the links on hover */
    .menu ul li:hover ul li a:hover {
    background:#dfc184; 
    color:#000;
    }
    


    Thanks in advance

      • 26016
      • 561 Posts
      Hi,
      I’ve used Stu’s excellent menus before. As great as they are, it’s not always obvious.
      There’s lots of styling that should be pulled in from here that isn’t:
      assets/templates/wayfinder/basic_dd.css

      The following should fix a lot of it, if not the whole thing. Here’s what Muddy has surrounding the menu:

      <div class="menu">
      <ul>....
      </ul>
      </div>

      Yours has that .menu class on the <ul> instead, like this:
      <ul class="menu">....
      </ul>

      That borks the CSS scheme. You need the surrounding DIV. That will get you moving in the right direction. If you made more changes, there may be more to fix.

      Stu’s menus, while amazing, are very complex and easily broken by fiddling with them. It’s not easy to mod them unless you’re very sharp on the CSS cascade. That’s the tricky thing... it’s great to get a super free menu, but then the client wants changes, and this can definitely weed out the newbies.

      I remember working on a site that used a dropdown, I used Stu’s one, and it worked out of the box. However, they wanted different colors on every level, different sized tabs, different font, different hover colors, on and on ad infinitum. That was hard. OH, and the kicker... they also wanted a drop-up at the bottom! It all worked, but not without a ton of work and testing.

      Good luck, Dave
        MODx and Wordpress development
        Linux, PHP 5.2, MySQL 5.0, Evo 1.05, Revo 2.08-pl, Firefox 4
        • 10529
        • 73 Posts
        Samba - Thanks for that - I have been making progress and now have various menus working - what I actualy did before I saw your post was strip about Muddy’s code down to the bare minimum and see what worked and what didn’t this is the html below
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
        <html>
        	<head>
        		<title>MuddyDogPaws.com | CSSplay Menu - Ultimate Dropdown</title>
                <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
              
        		
        	
        	
        	<link rel="stylesheet" media="all" type="text/css" href="assets/templates/wayfinder/ultimate_drop.css" />
        </head>
        	<body>
        		
        
        				
        			
        <div class="menu">
        [[Wayfinder? &startId=`0` &level=`3` &parentRowTpl=`cssplay_revParentRow` &cssTpl=`cssplay_ultdrop`]]
        </div>
        


        And the the css

        /* common styling */
        .menu {
        font-family: verdana, sans-serif;
        width:690px;
        position:relative;
        font-size:0.85em;
        z-index:100;
        }
        .menu ul {
        padding:0;
        margin:0;
        list-style-type: none;
        }
        .menu ul li {
        float:left;
        position:relative;
        }
        .menu ul li a, .menu ul li a:visited {
        display:block;
        text-decoration:none;
        color:#000;
        width:89px;
        height:3em;
        color:#000;
        border:1px solid #fff;
        border-width:1px 1px 0 0;
        background:#dfc184;
        padding-left:10px;
        line-height:3em;
        }
        * html .menu ul li a, .menu ul li a:visited {
        width:99px;
        w\idth:89px;
        }
        .menu ul li ul {
        display: none;
        }
        table {
        margin:-1px;
        border-collapse:collapse;
        font-size:1em;
        }

        /* specific to non IE browsers */
        .menu ul li:hover a,
        .menu ul li a:hover {
        color:#fff;
        background:#bd8d5e;
        }

        .menu ul li:hover ul,
        .menu ul li a:hover ul {
        display:block;
        position:absolute;
        top:3em;
        margin-top:1px;
        left:0;
        width:100px;
        }
        * html .menu ul li a:hover ul {
        margin-top:0;
        marg\in-top:1px;
        }

        .menu ul li:hover ul li ul,
        .menu ul li a:hover ul li a ul {
        visibility:hidden;
        position:absolute;
        height:0;
        width:0;
        }

        .menu ul li:hover ul li a,
        .menu ul li a:hover ul li a {
        display:block;
        background:#faeec7;
        color:#000;
        height:auto;
        line-height:1.2em;
        padding:5px 10px;
        width:79px
        }
        * html .menu ul li a:hover ul li a {
        width:100px;
        w\idth:79px;
        }

        .menu ul li:hover ul li a.drop,
        .menu ul li a:hover ul li a.drop {
        background:#c9c9a7 url(drop.gif) bottom right no-repeat;
        }

        .menu ul li:hover ul li a:hover,
        .menu ul li a:hover ul li a:hover {
        background:#c9c9a7;
        color:#000;
        }

        .menu ul li:hover ul li:hover ul,
        .menu ul li a:hover ul li a:hover ul {
        visibility:visible;
        position:absolute;
        left:100px;
        top:0;
        width:100px;
        }

        .menu ul li:hover ul li:hover ul.left,
        .menu ul li a:hover ul li a:hover ul.left {
        left:-100px;
        }

        I’m now playing around with the css http://www.anotherharddayattheoffice.co.uk to see what works and what doesn’t as well as trying to go through Kongondos very detailed wayfinder ebook.

        But you are so right - whilst the menus are very good - does take (well at least little old me) a lot of time & effort!

        Feel good when you suss it out though!

        Grrrrr just getting on really well till I went back and had a look in IE7 and it’s all gone pear shaped - back to the drawing board!
          • 26016
          • 561 Posts
          Hi,
          Glad you’re making progress. Pear-shaped, I like that description. smiley

          For my Euros a dropdown menu is just about the trickiest CSS challenge, unless you can somehow talk someone into accepting the out-of-the-box colours and scenario. I can think of a recent one I did that was even crazier, because JQuery was added to the mix as well.

          Though I think it’s fun to have a massive challenge, and I will persevere doggedly to make it work, I’ve begun warning clients that a modded dropdown is gonna cost ’em. smiley This way they don’t have heart failure when they see the number of hours. I end up doing them anyway, usually... clients ignore warnings, no matter how well-intentioned or explained.
            MODx and Wordpress development
            Linux, PHP 5.2, MySQL 5.0, Evo 1.05, Revo 2.08-pl, Firefox 4
            • 10529
            • 73 Posts
            Getting there with the clean look that I’m after - been playing around with this one http://www.anotherharddayattheoffice.co.uk/index.php?id=8 from the Muddy Paws Example 1 http://www.muddydogpaws.com/development/wayfinder/examples/example-1.html