We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40944
    • 78 Posts
    Okey, I am having this problem that even a mate that i quiet familiar with modX couldn’t solve it.

    The situation:
    I have got a main-menu, this is working with tabs. On the pages should be a sub menu. This all went fine, but on each page should be other links, that are part of the different tabs.
    You can see the webpage at: http://www.evd.timweb.nl/modx/

    What I want:
    The submenu should check a directory (what directory depends on which tab the visitor is on) and then it should place the links to the pages in the directory. Maybe it is a bit confusing... I hope you understand is though smiley

    So my question is: How to let the submenu check what pages are part of that particular tab.

    Greetings, Erwin

      • 25663 MODX Staff
      • 12,272 Posts
      Are you using Wayfinder to build your menus? If not, do that. If so, show us your call and Tpl files/chunks.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 40944
        • 78 Posts
        Oh yeah, of course.

        rowTlp:
        <li>
        <a href="[+wf.link+]" title="[+wf.title+]" [+wf.attributes+]><span>[+wf.linktext+]</span></a>
        [+wf.wrapper+]
        </li>

        hereTlp
        <li class="huidig">
        <a href="[+wf.link+]" title="[+wf.title+]" [+wf.attributes+]><span>[+wf.linktext+]</span></a>
        [+wf.wrapper+]
        </li>

        hereSubTlp
        <li class="huidig">
        <a href="[+wf.link+]" title="[+wf.title+]" [+wf.attributes+]><span>[+wf.linktext+]</span></a>
        [+wf.wrapper+]
        </li>

        <ul id="tabmenu">
        <li><a href="[+wf.link+]" class="rtablink" title="[+wf.title+]" [+wf.attributes+]><img src="images/icons/check.gif" alt="icon" />[+wf.linktext+]</a></li>
        [+wf.wrapper+]
        </ul>

        ("Huidig" = dutch for current)

        So yes, it is done with wayfinder though my friend did erhm like all the work=P

        Edit:
        Forgot some stuff:
        [!Wayfinder?startId=`0` &hereClass=`current` &level=`1` &rowTpl=`rowTpl` &hereTpl=`hereTpl`!] [<-- EDIT]
        [!Wayfinder?startId=`0` &hereClass=`` &selfClass=`current` &innerRowTpl=`hereSubTpl`!]

        Sorry!
          • 25663 MODX Staff
          • 12,272 Posts
          And your CSS too ... forgot that one. What is "&clicheren" in your first call. I don’t think that’s part of Wayfinder.
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 40944
            • 78 Posts
            Unfortunately i can’t tell you what that &clicheren is for, as I already said, a friend of mine did this. He doesn’t know what is wrong with it so he recommended me to ask it here. I already asked him why it’s there, but he is currently away from his keyboard. [Check edit @ bottom of this post]

            About the CSS, I suppose you only want the CSS that is part of the menu.

            /*********************
            RECHTER TAB MENU (=dutch for right menu tab
            *********************/
            #rtab ul {
            width:					140px;
            font:					13px verdana;
            }
            #rtab ul li {
            list-style:				none;
            }
            .rtablink {
            width:					140px;
            display:				block;
            }
            	/*******************
            	STATUS = NORMAAL
            	*******************/
            	#rtab ul li a img {
            	visibility:				hidden;
            	border:					0px;
            	}
            		#rtab ul li a:link, #rtab ul li a:visited {
            		color:					#565656;
            		text-decoration:		none;
            		line-height:			20px;
            		background-image:		url('../images/menu/rmenu.jpg');
            		background-position:	top;
            		border-bottom:			1px dashed #B0C4DE;
            		}
            	/****************
            	STATUS = HOVER
            	****************/
            	#rtab ul li a:hover img, #rtab ul li a:visited:hover img {
            	visibility:				visible;
            	margin-left:			14px;
            	}
            		#rtab ul li a:hover, #rtab ul li a:visited:hover {
            		color:					#222222;
            		font-weight:			bold;
            		background-image:		url('../images/menu/rmenu.jpg');
            		background-position:	bottom;
            		}
            


            Don’t think it’s usefull, but this is the CSS for the main menu:
            #menu ul {
            font:					bold 13px 'Trebuchet MS', verdana;
            text-align:				center;
            }
            #menu ul li {
            list-style:				none;
            margin-left:			5px;
            display:				inline;
            }
            #menu ul li a:link, #menu ul li a:visited {
            color:					#333399;
            background-color:		#82A6CA;
            }
            	/*******************
            	STATUS = NORMAAL
            	*******************/
            	#menu ul li a {
            	background-image:		url('../images/menu/menu_left.jpg');
            	background-repeat:		no-repeat;
            	text-decoration:		none;
            	background-position:	left top;
            	}
            		#menu ul li a span {
            		background-image:		url('../images/menu/menu_right.jpg');
            		background-position:	top right;
            		background-repeat:		no-repeat;
            		text-decoration:		none;
            		padding-left:			12px;
            		padding-right:			12px;
            		}
            	/****************
            	STATUS = HOVER
            	****************/
            	#menu ul li a:hover, #menu ul li a:visited:hover {
            	color:					#000;
            	background-color:		#92B1D1;
            	background-image:		url('../images/menu/menu_left.jpg');
            	background-repeat:		no-repeat;
            	background-position:	left;
            	}
            		#menu ul li a:hover span, #menu ul li a:visited:hover span {
            		background-image:		url('../images/menu/menu_right.jpg');
            		background-repeat:		no-repeat;
            		background-position:	100% 50%;
            		padding-left:			12px;
            		padding-right:			12px;
            		}
            	/*****************
            	STATUS = HUIDIG
            	*****************/
            	#menu ul .huidig a:link, #menu ul .huidig a:visited, #menu ul .huidig a:hover, #menu ul .huidig a:visited:hover {
            	color:					#000;
            	background-color:		#B0C4DE;
            	background-image:		url('../images/menu/menu_left.jpg');
            	background-repeat:		no-repeat;
            	background-position:	bottom left;
            	}
            		#menu ul .huidig a:link span, #menu ul .huidig a:visited span, #menu ul .huidig a:hover span, #menu ul .huidig a:visited:hover span {
            		background-image:		url('../images/menu/menu_right.jpg');
            		background-repeat:		no-repeat;
            		background-position:	bottom right;
            		padding-left:			12px;
            		padding-right:			12px;
            		}
            


            EDIT:
            Something really weird happened. When I checked it again it was just like this:
            [!Wayfinder?startId=`0` &hereClass=`current` &level=`1` &rowTpl=`rowTpl` &hereTpl=`hereTpl`!]

            BTW if you want to see the whole CSS: http://www.evd.timweb.nl/modx/assets/templates/hbs/css/style.css
              • 7231
              • 4,205 Posts
              I am not sure I understand correctly, but from what I gather by looking at the site is that you have the same list in both submenu and main menu areas, but what you want is to have the submenu to show the pages within the section. Is this correct?

              If so, it is just a matter of setting the startId of the submenu to a parent level container rather than to the root. You have both menu’s starting at Id 0. Try using UltimateParent to determine the &startId like this to get the first sub level:

              [[UltimateParent? &topLevel=`2`]]

              So the wayfinder call would lool like this:
              [!Wayfinde? &startId=`[[UltimateParent? &topLevel=`2`]]` &hereClass=.....
                [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                Something is happening here, but you don&#39;t know what it is.
                Do you, Mr. Jones? - [bob dylan]
                • 40944
                • 78 Posts
                It worked!

                Thank you very much. Now only a few things left, and this website is ready for his new owner!

                Goodmorning and a nice weekend to all!