We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18403
    • 14 Posts
    I have a big problem with CSS Navigation, I use the Template Andreas01 and by default it shows me all the Levels of my Website, i only wann see the mainlevel and on klick one level under.
    This is the original CSS from the Template:

    /* MENU */
    #sideMenu ul {
    list-style:none;
    width:150px;
    padding:0;
    }
    #sideMenu a {
    font-weight:bold;
    height:20px;
    text-decoration:none;
    color:#505050;
    display:block;
    padding:2px 0 0 4px;
    background:#f4f4f4;
    border-left:4px solid #cccccc;
    font-size:1.1em;
    }

    #sideMenu li.here a {
    color:#3f729f;
    }


    #sideMenu div.subdiv a {
    color:#505050;
    }
    #sideMenu div.subdiv li.here a {
    color:#3f729f;
    }
    #sideMenu a:hover, #sideMenu div.subdiv a:hover, #sideMenu li.here a:hover {
    background:#eaeaea;
    color:#286ea0;
    border-left:4px solid #286ea0;
    }
    #sideMenu ul li ul li a {
    }


    And this is the change i made (found in Forum), so i get the first level closed but after klicking a item with sublevels i get all sublevels under this point,



    /* new */

    #sideMenu li ul{
    display:none;
    }
    #sideMenu li.here ul{
    display:block;
    }
    #sideMenu li.here ul a{
    color:#3f729f;
    }
    /* new */



    /* old
    #sideMenu li.here a {
    color:#3f729f;
    }
    */



    Is there someone out on this november sunday, who can help me?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      You just need to add another layer to the ul li ul li... instructions, as many as you have levels in the menu.
      li.here li ul{
      display:none;
      }
      li.here li.here ul{
      display:block;
      }
      

      it does get a little confusing, but if you study the view source of the whole menu it begins to come clear.
        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
        • 18403
        • 14 Posts
        Im really confused..... you mean like this?

        /* MENU */
        #sideMenu ul {
        list-style:none;
        width:150px;
        padding:0;
        }
        #sideMenu a {
        font-weight:bold;
        height:20px;
        text-decoration:none;
        color:#505050;
        display:block;
        padding:2px 0 0 4px;
        background:#f4f4f4;
        border-left:4px solid #cccccc;
        font-size:1.1em;
        }
        /* eingefuegt */

        #sideMenu li ul{
        display:none;
        }
        #sideMenu li.here ul{
        display:block;
        }
        #sideMenu li ul{
        display:none;
        }
        #sideMenu li.here ul{
        display:block;
        }


        #sideMenu li.here ul a{
        color:#3f729f;
        }

        /* eingefuegt */

        /*
        #sideMenu li.here a {
        color:#3f729f;
        }
        */

        #sideMenu div.subdiv a {
        color:#505050;
        }
        #sideMenu div.subdiv li.here a {
        color:#3f729f;
        }
        #sideMenu a:hover, #sideMenu div.subdiv a:hover, #sideMenu li.here a:hover {
        background:#eaeaea;
        color:#286ea0;
        border-left:4px solid #286ea0;
        }
        #sideMenu ul li ul li a {
        }
          • 18403
          • 14 Posts
          is this the right way?


          #sideMenu li ul{
          display:none;
          }
          #sideMenu li.here ul{
          display:block;
          }
          #sideMenu li.here ul a{
          color:#3f729f;
          }

          #sideMenu li li ul{
          display:none;
          }
          #sideMenu li.here li.here ul{
          display:block;
          }
          #sideMenu li.here li.here ul a{
          color:#3f729f;
          }
          #sideMenu li li li ul{
          display:none;
          }
          #sideMenu li.here li.here li.here ul{
          display:block;
          }
          #sideMenu li.here li.here li.here ul a{
          color:#3f729f;
          }
            • 18403
            • 14 Posts
            Anyone out there who can give me a little bit assistance with this css thing?
              • 10746
              • 126 Posts
              Quote from: markus2h at Nov 12, 2006, 08:21 AM

              Anyone out there who can give me a little bit assistance with this css thing?

              I can’t help easily with the CSS, but I am not sure that this is the right way to approach it .. you are essentially trying to use CSS to "program" your menus rather than just display them. I would change the menu to Wayfinder and then use Wayfinder to program WHAT is displayed, and the CSS just to style the display...

              The trouble with doing it in CSS alone is that you have to supply style for EVERY POSSIBLE combination of menu item (ie active, hover, .here) at EVERY POSSIBLE depth in the tree..

              I do intend to explore in more detail Wayfinder’s capabilities for new users (like myself), but it won’t be for a few more days at least.

              Cheers

              Gordon