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

    I feel a bit embarrassed about this, but I can’t figure out how to get my navigation styling in place ?
    I’ve got this in my template which brings the links in okay, but without the styling from the div huh

    <div id="navcontainer">
    [[MenuBuilder?id=0]]
    </div>

    I need to include other sub menus in various sections and i think i need to create snippets for that but its all getting a bit confusing... i can’t find an example in the documentation to follow ... canb anyone point me in the right direction ??

    Ta
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      You can use the same snippet (in this case you are using MenuBuilder) as often as you like on the same page, just make the snippet arguments different for getting different stuff:

      <div id="mainmenu">
      [[MenuBuilder?id=0&depth=5]]  - gets the whole thing (if your document tree is no more than 5 levels)
      </div>
      
      <div id="sidemenu">
      [[MenuBuilder?id=5&depth=1]] - gets a single-level menu of docs in folder 5
      </div>
      


      However, if you are using serious CSS styling, it would be better to use one of the list menu generating snippets that create a simple unordered lists with all sorts of options for id and class names for the list elements. You call them in a similar manner, specifying what folder you want to start with and how many levels, among other options, and then style the list in your CSS. My personal favorite at the moment is ListMenuX.
        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
        • 32230
        • 18 Posts
        Thanks Susan.

        Am i right in thinking that I need to use TVs in order to define the correct sidemenu to show on each specific page within a section/folder ?
        Do I need to create a chunk and save it as a TV ?? You can see how confused I’m getting !!

        I would like to use some CSS styling - but am not sure what to do with the example Menu code ?
          • 32230
          • 18 Posts
          Thanks for the ListMenuX tip ...

          Not sure exactly what happened, but when I used that snippet for my main nav - everything else fell into place straight away - all my existing CSS showed up and took care of itself !!!

          Only the sidemenu to sort out now, newly inspired !!
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Yes, a TV would be the best way to do that. One method is discussed here:

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

            And another:

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

            As far as styling goes, basic styling for the MenuBuilder links could look something like this:

            #left a {
                padding: 4px;
            	margin: 3px 0;
            	display: block;
            	color:#003399;
            	font-size:14px;
            	font-style:italic;
            	font-weight:bold;
                }
            
            #left a:hover {
            	padding: 4px;
            	text-decoration: none; 
            	color: #821517;
                }
            


            Of course, it’s a bit more complex if you use a list menu generator. There are a lot of good tutorial sites for styling list menus (Google is your friend!); it helps to make a copy of the View->Source from your browser, so you can actually visualize the various div and ul and li and a elements, their id and class names.
              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
              • 32230
              • 18 Posts
              Thanks again for that.

              I’m okay with CSS - quite strong in fact.
              Its just all this CMS stuff that I’m new to !!!

              I’m keen to learn more and utilise - but I’m also on a deadline - and those things don’t always mix !!
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                The new default menu is DropMenu, but it is quite flexible and complex, and I haven’t gotten my head around it yet; that’s why I mentioned ListMenuX, because I won’t point somebody to something I don’t have control of myself. But if you are good with CSS, you may prefer DropMenu.
                  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
                  • 32230
                  • 18 Posts
                  I see that the ListMenuX menu only works at the root level or below - which must be why my menus don’t show up on pages that are within folders ..... hmmm

                  Is there a variable somewhere in the snippet that can be changed to allow this to work within directories ??

                  All i see is PHP (and I don’t understand what I’m looking at ....)

                  Also - just where can i find the DropMenu snippet huh?
                  I see those examples on http://modxcms.com/snippet-dropmenu.html (but thats for calling the snippet isn’t it ?) - but is there a full snippet script somewhere that I can add to a TV huh Its not listed within ’snippets’ for me - and once again I’m lost ....???
                    • 25663 MODX Staff
                    • 12,272 Posts
                    DropMenu is installed with the demo site (and I think new installs) of 0.9.0.
                      Ryan Thrash, MODX Co-Founder
                      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                      • 32230
                      • 18 Posts
                      Quote from: rthrash at Nov 02, 2005, 08:38 AM

                      DropMenu is installed with the demo site (and I think new installs) of 0.9.0.

                      The zipped modx version I have installed is this : 1[1].0-pre3.2(rev270)
                      .... but its not listed in my snippet library ??

                      Can i copy and paste it from somehere ?