We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4095
    • 372 Posts
    That stopped the Sub Submenu from appearing altogether, even when clicking on its direct pearent. Also the Submneu doesn’t change colour if the (now hidden) Sub Submenu exists below it.
      [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
      Add to the end:
      #menu li.here li.here ul {
          display: block
      }
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 4095
        • 372 Posts
        Quote from: rthrash at Nov 30, 2005, 06:36 PM

        Also if you could send over real code and css output, it’d be more helpful on the html side.

        Thanks for you fast responses! Its taken me hours and I just couldn’t sort it out, I guess I needed a grown up to help LOL

        This is with the previous additions you suggested. The menu ouptut is if I had selected "Temp" > "Operations Level", the Sub Submenu called "Emergency Management L2" is now visible.

        Just have the colour issue now and adding color: #000080; to either additions didn’t fix it. I’ll keeping playing while I wait to see if I can figure it out smiley

        }

        <div id="menu">
        	<ul class="topmenu">
        		<li><a href="home.html" title="Emergency Management Academy of NZ">Home</a></li>
        		<li><a href="news.html" title="News Articles">News</a></li>
        		<li><a href="about.html" title="Emergency Management Academy of NZ">About us</a>
        			<ul>
        				<li class="last"><a href="people.html" title="EMANZ staff">People</a></li>
        			</ul>
        		</li>
        		<li><a href="vacancies.html" title="Job vacancies">Vacancies</a></li>
        		<li><a href="courses.html" title="EMANZ Training">Training</a>
        			<ul>
        				<li><a href="certificates.html" title="Tai Poutini Polytechnic<br/>Emergency Management Programme">Certificates</a></li>
        				<li><a href="short-courses.html" title="Short Courses">Short Courses</a></li>
        				<li class="last"><a href="calander.html" title="Events Calendar">Calendar</a></li>
        			</ul>
        		</li>
        		<li><a href="gallery.html" title="Photo Gallery">Gallery</a></li>
        		<li><a href="faqs.html" title="Frequently Asked Questions">FAQs</a></li>
        		<li><a href="links.html" title="Web Links">Links</a></li>
        		<li><a href="contact.html" title="Contact us">Contact us</a></li>
        		<li><a href="login.html" title="User Login">Login</a></li>
        		<li class="last here"><a href="temp.html" title="Temporary stuff">Temp</a>
        			<ul>
        				<li class="here last"><a href="operations.html" title="Operations Level Courses">Operations Level</a>
        					<ul>
        						<li class="last"><a href="certificate-in-emergency-management-2.html" title="Tai Poutini Polytechnic Certificate in Emergency Management Level 2">Emergency Management L2</a></li>
        					</ul>
        				</li>
        			</ul>
        		</li>
        	</ul>
        </div>  



        Here is the CSS for it

        #menu a{
        	text-decoration: none;
        }
        #menu a:link{
        	color: #000000;	/* non current menu color */
        }
        #menu a:visited{
        	color: #000000;
        }
        #menu a:hover, #menu a:active{
        	color: #FF0000;
        	background-color: transparent;
        	text-decoration: none;
        }
        #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;
        }
        
        /* new additions */
        #menu li.here ul ul {   
        	display: none;	
        }
        #menu li.here li.here ul {
            display: block
        }
        
          [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
          So if I underestand it correctly, it seems to be working now except for colors at the various levels?

          What color is each level supposed to display as and I’ll whip up a couple of fixes for you fast. smiley

          Or altenately, I bet that this works:
          li.here a { color: #000080 }
          li.here li.here a {color: #008000 }

          (alter colors to fit as needed...)
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 4095
            • 372 Posts
            Correct, just an issue with colour now... which is progress smiley

            I tried the code in a few different ways but didn’t work, currently I use the following code to get the colour. The idea is ONLY the current selected item to be Blue (#000080), the rest the defalt black colour.

            #menu li.here{	/* current Menu item*/
            	color: #000080;
            }
            


              [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
              Unless you turn off current as link, your entire tree will be colored via the here state. That is why it was left out of the snippet to begin with. To get the styling that way, here’s how to do it:

              #menu li a { color: #000 } // default non-current link
              #menu li.here a { color: #000 } // parent/grandparent links
              #menu li { color: #000080 } // blue for the you-are-here state
              


              Note the li.here a rule is not needed unless you want to change the way they show to indicate the path.
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 4095
                • 372 Posts
                Quote from: rthrash at Nov 30, 2005, 07:41 PM

                Unless you turn off current as link, your entire tree will be colored via the here state.

                Sweet, I had it off anyway.

                Quote from: rthrash at Nov 30, 2005, 07:41 PM

                Note the li.here a rule is not needed unless you want to change the way they show to indicate the path.

                Now I’m more confused, if I remove the "li.here a" then I get no colours at all. I must be doing something else wrong?
                  [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
                  Not true. If the current location is the only non-link, then it gets the blue color from the #menu li rule. The others a elements, which are links, get the black color from the #menu a rule. It’s all about the cascade and specificity. No a-element, nothing to make black... remove the coloring rules from the other CSS.
                    Ryan Thrash, MODX Co-Founder
                    Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                    • 4095
                    • 372 Posts
                    Thanks for ya help Ryan... I just can’t get my head around or make senese how these lists behave, no matter what I do I can’t get it to work correctly.

                    What you say makes sense, so I’m going to try again from scratch and see if I can’t figure it out, otherwise I’ll resign myself to the fact I can’t do 3 deep menus with the current item highlighted. (can do it with 2 deep) >:(

                    Thaks agian for your paitence and assistance embarrassed

                      [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
                      You definitely can do it 3 deep as long as you have current as link off. Based on your code above:
                      		<li class="last here"><a href="temp.html" title="Temporary stuff">Temp</a>
                      			<ul>
                      				<li class="here last"><a href="operations.html" title="Operations Level Courses">Operations Level</a>
                      					<ul>
                      						<li class="last"><a href="certificate-in-emergency-management-2.html" title="Tai Poutini Polytechnic Certificate in Emergency Management Level 2">Emergency Management L2</a></li>
                      					</ul>


                      The selected level still has a link:

                      				<li class="here last"><a href="operations.html" title="Operations Level Courses">Operations Level</a>


                      If it didn’t, it would look like this:

                      				<li class="last">Operations Level


                      and the only CSS you’d need for colors based on your desired behavior description would be:

                      #nav a { color: #000 }
                      #nav li { color: #000080 }

                      (plus all the previous show/hide stuff above of course!)
                        Ryan Thrash, MODX Co-Founder
                        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me