We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12147
    • 182 Posts
    I promise I have read everything I can find, but Wayfinder’s clarity and ease of use is eluding me, especially considering I have a site deadline in 4 hours undecided Could someone give me a hand, please?? (I am a Green Newbie at this point)

    I’ve got a template and pages made from it and all is well, with the exception of two main problems:
    1. Side menus and sub-menus therein
    2. Content links

    1. I’ve got 3 separate vertical menus in the left column, two of them with submenus. How do I tell Wayfinder to create 3 separate menus, how do I specify which pages are in each menu, and how do I also create and specify the submenus?

    2. How do I create links to other pages within the website within the content text? (tried searching for this but couldn’t find info)

    I would be more than happy to post my navigation code and would be serious grateful for any help. Not to repeat, but I don’t grok php too well, so pretend you’re talking to a 4 year old. wink

    Thanks very much!!
      • 4310
      • 2,310 Posts
      [!Wayfinder? &startId=`0` &level=`2` !]

      Where 0 is the parent of the section of pages/docs you want the menu to represent, just repeat it for each menu, changing the number of the parent.
      You may well need to use tpl chunks to customise the layout of the menu.
      <a href="[~16~]"> your link text here</a>

      Where 16 is the id of the page/doc you want to link to.
      I’m being deliberately brief as you’re short on time!
        • 12147
        • 182 Posts
        Thank you!

        This is travesty, asking such a thing, but -for now- could I skip Wayfaring the menus and just use the page links within the current ul/li setup, a la "<a href="[~16~]"> your link text here</a>"....would this work until I have time to make things right??

        Emergency Configuration Pack, anyone??!

          • 4310
          • 2,310 Posts
          Okay, for a quick solution just use :
          <ul>
          <li><a href="[~1~]"> parent one</a>
          <ul>
          <li><a href="[~2~]"> first child of one</a></li>
          <li><a href="[~3~]"> second child of one</a></li>
          <li><a href="[~4~]">  third child of one</a></li>
          </ul></li>
          <li><a href="[~5~]"> parent two</a>
          <ul>
          <li><a href="[~6~]">  first child of two</a></li>
          <li><a href="[~7~]"> second child of two</a></li>
          <li><a href="[~8~]">third child of two</a></li>
          </ul></li>
          </ul>
          

          So on and so forth
            • 17883
            • 1,039 Posts
            Please provide some more infos about your site structure... Make a screenshot of the opened tree structure in the manager and then tell us how the menus should look like. A link to your installation would also be very useful.
              • 12147
              • 182 Posts
              Here is a link to where it’s all installed right now: http://www.gmhainc.dreamhosters.com/
              (The old site is currently hosted elsewhere.) This shows the three menus and their expansion/submenus pretty well.

              Any more info I can furnish?
                • 7231
                • 4,205 Posts
                You will need 3 Wayfinder calls to get those menus. You will need to use custom rowTpl, innerRowTpl and parentRowTpl.

                Check out the parameters available at: http://www.muddydogpaws.com/development/wayfinder/parameters.html
                  [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]
                  • 12147
                  • 182 Posts
                  Thanks... I’ve looked at everything on those pages, and my mind is shutting down on me because it looks so complicated - I don’t know where to begin and I have so little time right now embarrassed

                  I suspected this all seemed too easy...

                    • 17883
                    • 1,039 Posts
                    Well, let`s take look... You have three menus, some have one more level as a submenu. You organizaton of documents should look like:

                    - Quick Links (folder, no content), ID e.g. 2

                        * Volunteering (subdocument of "Quick Links")
                        * Calendar (subdocument of "Quick Links")
                        * Competitions (folder, with content)
                              o Dressage (subdocument of "Competetions")
                              o Driving (subdocument of "Competetions")
                              o Eventing (subdocument of "Competetions")
                              o Hunter/Jumper (subdocument of "Competetions")
                              o Trail (subdocument of "Competetions")
                        * Clinics (subdocument of "Quick Links")
                        * Special Events (subdocument of "Quick Links")
                        * Results (subdocument of "Quick Links")

                    About GMHA (folder, no content), ID e.g. 22

                        * About GMHA (see above)
                        * News & Press
                        * Capital Campaign
                              o Campaign Goals
                              o Trails
                              o Named Giving
                              o Planned Giving
                        * Sponsorship
                        * Membership

                    Home/Site (folder, no content), ID e.g. 44

                        * Home (the default homepage)
                        * Links
                        * Site Map
                        * Directions
                        * Contact Us

                    Okay, then let`s look how to build the menus...

                    Initially, you need three wayfinder calls for the three menus. I put in some IDs for example (the three "root" folders).

                    For the sake of the urgent case I’ll take your source, which looks like this at the moment:

                    <!-- left column start -->
                    <h4>Quick Links</h4>
                    <!-- add space before </a> - solves extra whitespace problem in IE6 Win2000 -->
                    	<div id="p7swapmenu1"> 
                      <ul> 
                        <li class="single"><a href="volunteer-opportunities.html">Volunteering </a></li> 
                    	<li class="single"><a href="gmha-calendar.html">Calendar </a></li> 
                    	<li class="closed" id="p1"> <a href="competitions.html" onClick="P7_swapClass(1,'p1','open','closed','li')">Competitions </a> 
                          	<ul> 
                    	  	<li><a href="dressagecompetition.html">Dressage </a></li>
                    
                    		<li><a href="drivingcompetition.html">Driving </a></li>  
                            <li><a href="eventingcompetition.html">Eventing </a></li> 
                            <li><a href="hunterjumpercompetition.html">Hunter/Jumper </a></li> 
                            <li><a href="trailcompetition.html">Trail </a></li>
                    		</ul> 
                        </li>
                    	<li class="single"><a href="clinics.html">Clinics </a></li>  
                        <li class="single"><a href="special-events.html">Special Events </a></li> 
                        <li class="single"><a href="gmharesults.html">Results </a></li>
                    
                      </ul><!-- end first bunch -->
                      </div>
                      
                      <!-- start 2nd bunch/static links -->
                      <h4>About GMHA </h4>
                      <div id="p7swapmenu2"> 
                      	<ul>
                      		<li class="single"><a href="aboutgmha.html">About GMHA </a></li>
                    		<li class="single"><a href="news-press.html">News & Press </a></li>
                    
                    		<li class="closed" id="p2"><a href="capitalcampaign.html" onClick="P7_swapClass(1,'p2','open','closed','li')">Capital Campaign </a> 
                          		<ul> 
                            	<li><a href="campaign-goals.html">Campaign Goals </a></li>
                    			<li><a href="gmha-trails.html">Trails </a></li>
                    			<li><a href="named-giving.html">Named Giving </a></li>
                    			<li><a href="planned-giving.html">Planned Giving </a></li>
                    			</ul>
                    
                    		</li>
                           <li class="single"><a href="sponsorship.html">Sponsorship </a></li>
                    		<li class="single"><a href="gmha-membership.html">Membership </a></li> 
                    	</ul>
                    	</div>
                    	<!-- start 3rd bunch static links -->
                    	<h4>Home/Site</h4>
                    	<div id="p7swapmenu3"> 		
                    		<ul> 
                            	<li class="single"><a href="index.html">Home </a></li>
                    
                    			<li class="single"><a href="links.html">Links </a></li>
                    			<li class="single"><a href="sitemap.html">Site Map </a></li>
                    			<li class="single"><a href="gmha-directions.html">Directions </a></li>
                    			<li class="single"><a href="contact-information.html">Contact Us </a></li>
                    		</ul> 
                      	</div><!--end swapmenus-->
                    


                    You have a special thing in there, which I will try to describe later. First of all, we build the three wayfinder calls in your template:

                    <!-- left column start -->
                    <h4>Quick Links</h4>
                    	<div id="p7swapmenu1"> 
                    [!Wayfinder?startId=`2` &rowTpl=`menu_row_tpl` &parentRowTpl=`menu_parent_row_tpl` &rowIdPrefix=`p`!]
                    <!-- end first bunch -->
                      </div>
                      
                      <!-- start 2nd bunch/static links -->
                      <h4>About GMHA </h4>
                      <div id="p7swapmenu2"> 
                    [!Wayfinder?startId=`22` &rowTpl=`menu_row_tpl` &parentRowTpl=`menu_parent_row_tpl` &rowIdPrefix=`p`!]
                      </div>
                    
                    	<!-- start 3rd bunch static links -->
                    	<h4>Home/Site</h4>
                    	<div id="p7swapmenu3"> 		
                    [!Wayfinder?startId=`44` &rowTpl=`menu_row_tpl` &parentRowTpl=`menu_parent_row_tpl` &rowIdPrefix=`p`!]
                      	</div><!--end swapmenus-->


                    First we tweak the standard list element template &rowTpl of wayfinder, because we need the class "single" in it:

                    [!Wayfinder?startId=`1` &rowTpl=`menu_row_tpl`!]

                    Create a chunk "menu_row_tpl" with this content:

                    <li[+wf.id+] class="single [+wf.classnames+]">
                    	<a href="[+wf.link+]" title="[+wf.title+]" [+wf.attributes+]>[+wf.linktext+]</a>
                    	[+wf.wrapper+]
                    </li>


                    This is the standard row template, but with this additional class "single".

                    This will result in the correct menus (I hope), but without the javascript thing.

                    To get this working we’ll have to tweak another template of wayfinder. Let’s look at the parameters...

                    There we find:

                    &parentRowTpl
                        default: NULL
                        values: name of template chunk
                        description: The parentRowTpl template is used when processing items that are folders with their children being displayed in the menu.
                        available placeholders: Same as RowTpl.
                        example:

                        <li[+wf.classes+]>
                        <a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]»</a>
                        [+wf.wrapper+]
                        </li>


                    That is what we need, because every document which has child elements is treated different. We want to achieve this output:

                    <li class="closed" id="p2"><a href="capitalcampaign.html" onClick="P7_swapClass(1,'p2','open','closed','li')">Capital Campaign </a> 


                    So we create a chunk named "menu_row_parent_tpl" with this content:

                    <li[+wf.id+] class="closed [+wf.classnames+]">
                    	<a href="[+wf.link+]" onClick="P7_swapClass(1,'p[+wf.docid+]','open','closed','li')"  title="[+wf.title+]">[+wf.linktext+]</a>
                    	[+wf.wrapper+]
                    </li>


                    What does it do? First, let’s take a look at the final wayfinder call:

                    [!Wayfinder?startId=`1` &rowTpl=`menu_row_tpl` &parentRowTpl=`menu_parent_row_tpl` &rowIdPrefix=`p`!]


                    &startId is the ID of the folder containing the documents.
                    &rowTpl is the modified standard list element
                    &parentRowTpl is the modified list element that has child documents
                    &rowIdPrefix creates an unique ID for each list element, here "p" + the ID

                    That is all we need (I think) to build the output. Look at the modified parentRowTpl, I put in the unique IDs as "[+wf.id+]" which will create something like id="p23" for the list element which points to doc 23. Then in the javascript call I put in another place holder "[wf.docid+]" to match the corresponding list element id.

                    Hope this works... All out of my head, which is getting tired (past one in the morning over here in germany...).

                    Regards,
                    Marc
                      • 12147
                      • 182 Posts
                      Marc,

                      You are...well, amazing. You’ve explained things every step of the way, allowing me to think that I might just be able to understand all this - how great! I’ve got a lot of studying ahead ... so now I try to plug this all in and hope I don’t mess it up.

                      What a gift to have all this - thank you so much. You should post this in the Wiki to share with the bigger world; you have great talent in explaining things!

                      I’ll be back to make a report. Again, many thanks indeed.

                      Wendy