We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21477
    • 25 Posts
    Told you I would be back!

    Where in the snippets for the menu does it define the CSS ID?

    It seems I can do some fantastic things but have to call them in the proper place.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      The best way to see what you have to work with is to do a "view source", copy that to a color-coded HTML editor, and look at how the menu is laid out.

      For example the page for the MODx homepage has this:

      <div id="links">
        <h3>The Site</h3>
      
        <ul class="topnav">
          <li class="here">Home</li>
      <li><a href="features.html" title="What's Fresh...">Features</a></li>
      <li><a href="community-forums.html" title="MODx Community Forums">Forums</a></li>
      <li><a href="documentation.html" title="Documentation">Documentation</a>
        <ul class="subnav">
      


      Here you’ve got your div, id="links", the ul with the class="topnav", an inner li with the class="subnav". All just begging to be styled!

      You can change most of the default class names in the snippet call if you prefer.

      http://modxcms.com/snippet-dropmenu.html
        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
        • 26435
        • 1,193 Posts
        Excellent point Susan!
        DropMenu does a great job of "classing" items that you did not specify a class or id for. checking the source after you "Launch Site" from the manager is really the only way to check what unspecified elements were classed by "El Drop-oMenuoso Fantastico". That’s one of the really great things about this snippet. It already did the labeling you never thought about, and as Susan stated, it is "Just begging to be styled!"

        -sD-
        scotty Delicious
          Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
          All of the above... in no specific order.


          I send pointless little messages
          • 21477
          • 25 Posts
          Susan and Scotty - Thanks for the help.
          Its not often people take time to help others (at least in my experance) so THANK YOU!
            • 18397
            • 3,250 Posts
            You’ll find that people around here tend to help.....
              • 26435
              • 1,193 Posts
              I was looking at the source for your site while I was on the page

              Rights of Passage-
              - Funerals

              and FireFox generated this code for your navigation <ul>:
              <div class="sideblock" id="sideMenu">
              
              	<ul class="topnav">
              		<li><a href="index.php?id=1" title="">Home</a></li>
              		<li><a href="index.php?id=3" title="">Beliefs</a></li>
              		<li class="here"><a href="index.php?id=4" title="">Rites of Passage</a>
              			<ul>
              				<li><a href="index.php?id=5" title="Rites of Passsage : Weddings">Weddings</a></li>
              			    <li class="here"><a href="index.php?id=10" title="Funerals">Funerals</a></li>
              				<li class="last"><a href="index.php?id=11" title="Baptisms">Baptisms</a></li>
              			</ul>
              
              		</li>
              		<li><a href="index.php?id=12" title="Services">Services</a>
              			<ul>
              			<li><a href="index.php?id=14" title="Spacial Services">Spacial Services</a></li>
              			<li class="last"><a href="index.php?id=16" title="Ministers Sermons">Ministers Sermons</a></li>
              		</ul>
              		</li>
              		<li><a href="index.php?id=13" title="Sunday School">Sunday School</a></li>
              		<li><a href="index.php?id=17" title="Activites">Activites</a></li>
              		<li><a href="index.php?id=18" title="Diary">Diary</a></li>
              		<li><a href="index.php?id=19" title="Magazine">Magazine</a>
              
              			<ul>
              				<li><a href="index.php?id=20" title="Ministers Monthly">Ministers Monthly</a></li>
              				<li class="last"><a href="index.php?id=21" title="Special items of news">News</a></li>
              			</ul>
              		</li>
              		<li><a href="index.php?id=22" title="Local History">Local History</a></li>
              		<li><a href="index.php?id=23" title="Chapel Histroy">Chapel Histroy</a></li>
              		<li><a href="index.php?id=24" title="Contact">Contact</a></li>
              		<li><a href="index.php?id=25" title="Guestbook">Guestbook</a></li>
              		<li class="last"><a href="index.php?id=26" title="Links">Links</a></li>
              
              	</ul>
              </div>
              


              glancing over this, you may want to try :

              #sideMenu li.here ul li { color: #000; font-weight:bold; }
              #sideMenu li.here ul li a{ color: #000080; font-weight:bold; }
              


              to get the sub-menu items to show up purple, and the active sub-menu item to remain black. Just a thought.

              -sD-
              scotty Delicious
                Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                All of the above... in no specific order.


                I send pointless little messages
                • 26435
                • 1,193 Posts
                nidave,

                I looked at your site again, this time using virtualPC with XP. looks good on IE6, looks too indented on every other browser. I have some more recommendations.

                #1) #sidemenu li.here ul { display: block; margin-left:[5]px; }
                should read:
                #sidemenu li.here ul { display: block; margin-left:5px; }
                the [X] example I gave was just for an example
                sorry for the confusion.

                #2) I think a conditional comment for IE might be the easiest solution for you.

                Put this in the head section of your html AFTER your </style> tag but before </head>.
                <!--[if IE]>
                     <style>
                	#sideMenu    { font-size: 10pt; font-size:10pt; text-align:left; text-indent:0; margin-left:10px; margin-right:2px; }
                        #sideMenu ul {list-style-image: url(images/next.gif); font-size:10pt; text-align:left; text-indent:0; margin-left:8px; margin-right:2px; }
                     </style>
                <![endif]-->
                


                then, replace the #sideMenu {} and #sideMenu ul {} with this:

                        #sideMenu    { font-size: 10pt; font-size:10pt; text-align:left; text-indent:0; margin-left:0; margin-right:2px; }
                        #sideMenu ul {list-style-image: url(images/next.gif); font-size:10pt; text-align:left; text-indent:0; margin-left:2px; margin-right:2px; }
                


                Give this a try, and let me know how it works out!

                Regards,

                -sD-
                scotty Delicious
                  Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                  All of the above... in no specific order.


                  I send pointless little messages
                  • 4095
                  • 372 Posts
                  I have been having 3 level menu problems for months and every now and then I work on it, never getting it sorted. With the site due to be finished soon I need some help.

                  I even changed from ListmenuX to DropMenu just in case that would make it easier.

                  I am pretty sure its all to do with not understanding the selectors as well as i thought I did and maybe some inheritance issues?


                  My structure looks like this (the colours are my attempt to make it easy to follow, and are not related to the actual menu colour):

                  Menu 1
                  --Submenu 1
                  Menu 2
                  --Submenu 2
                  --Submenu 3
                  ----Sub Submenu 1
                  --Submenu 4

                  The goal is that all Submenus are hidden until the direct pearent is selected, so Submenu 2, 3 & 4 are only visible when Menu 2 is selected, Sub Submenu 1 will stay hidden until Submenu 3 is selected

                  I assumed (obviously incorrectly) that if #menu ul was Menu and #menu ul ul was Submenu then #menu ul ul ul would be Sub Submenu.

                  However what happens is soon as I select Menu 2, Submenus 2, 3, 4 are visible but so is Sub Submenu 1.

                  #menu ul{   /* Menu */
                  	margin: 0;
                  	padding-bottom: 20px;
                  	padding-left: 10px;
                  }
                  #menu ul ul{   /* Menu > Submenu */
                  	display: none;	
                  }
                  #menu ul ul ul{   /* Menu > Submenu > Sub Submenu*/
                  	display: none;	
                  }
                  #menu li{	/* Menu items */
                  	list-style: none;
                  	padding: 2px 0 2px 0px;
                  	height: auto !important;
                  	height: 1%;
                  	font-size: 1.0em;
                  }
                  #menu li.here{	/* current Menu item*/
                  	color: #000080;
                  }
                  #menu li.here ul{	/* Menu > current Submenu items*/
                  	display: block;
                  	padding: 5px 0px 5px 20px;
                          color: #000080;
                  	font-size: 1.0em;
                  }
                  


                  The next issue is the coloring, and thats a little more confussing, but I guess its related to the above issue.

                  Menu 1
                  --Submenu 1
                  Menu 2
                  --Submenu 2
                  --Submenu 3
                  ----Sub Submenu 1
                  --Submenu 4


                  When a Submenu is selected and there is no Sub Submenu present (eg Submenu 1) it changes colour, however when a Sub Submenu is present (eg Submenu 3), the Submenu doesn’t change colour.

                  If I then select the Sub Submenu the Sub Submenu changes colour as intended.

                    [img]http://www.emanz.ac.nz/assets/images/logo/emanz-icon_16x16.gif[/img] Emergency Management Academy of New Zealand [br] http://www.emanz.ac.nz[br][br]MODx Sandbox Login: sandbox Password: castle [br]
                    Admin Sandbox Login: sandbox Password: castle
                    • 25663 MODX Staff
                    • 12,272 Posts
                    Try adding:
                    #menu li.here ul ul { 
                    	display: none;	
                    }


                    Menu ul ul also selects the third level menus also, FYI, because they are children of an existing UL (that just so happens to also have another UL above.
                      Ryan Thrash, MODX Co-Founder
                      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                      • 25663 MODX Staff
                      • 12,272 Posts
                      Also if you could send over real code and css output, it’d be more helpful on the html side.
                        Ryan Thrash, MODX Co-Founder
                        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me