We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 41972
    • 9 Posts
    Yes, I could re-structure it like that, but links I am wanting to be main non expandable items would need to be moved into a category and thus be initially hidden.

    I am getting outputs for wfParentRow, and wfInner, here is adjusted snippet code for you to see better:

    	<!-- ########################### NAV START ########################### -->
    	<div id="site-nav">
    		<div id="Nav">
    
    <li class="first active"><a href="http://127.0.0.1/Dev/cms/modx/www_revolution/" title="Home" >Home</a></li>
    
    
    <!-- wfParentRow start -->
    <div class='NavType1Expander' id="nav6"><a href='#'>Curriculum Vitae</a></div>
    <div class='NavType1Container' id="nav6Body">
    	<ul>
    	<!-- wfInner -->
    	<!-- wfInnerRowTpl -->
    
    	</ul>
    </div>
    <div class='NavType1ExpanderBase'></div>
    <!-- wfParentRow end -->
    
    
    
    
    
    
    <li><a href="index.php?id=8" title="Work history" >Work history</a></li>
    <li><a href="index.php?id=9" title="Portfolio" >Portfolio</a></li>
    
    
    <!-- wfParentRow start -->
    <div class='NavType1Expander' id="nav10"><a href='#'>HTML5, XHTML, CSS & JavaScript</a></div>
    <div class='NavType1Container' id="nav10Body">
    	<ul>
    	<!-- wfInner -->
    	<!-- wfInnerRowTpl -->
    	<!-- wfInnerRowTpl -->
    	<!-- wfInnerRowTpl -->
    	<!-- wfInnerRowTpl -->
    	<!-- wfInnerRowTpl -->
    	<!-- wfInnerRowTpl -->
    	<!-- wfInnerRowTpl -->
    	<!-- wfInnerRowTpl -->
    	<!-- wfInnerRowTpl -->
    	<!-- wfInnerRowTpl -->
    
    	</ul>
    </div>
    <div class='NavType1ExpanderBase'></div>
    <!-- wfParentRow end -->
    
    
    
    
    
    
    
    <!-- wfCategoryFoldersTpl -->
    <!-- wfInner -->
    	<!-- wfInnerRowTpl -->
    
    <li><a href="index.php?id=12" title="Away3D 3.x" >Away3D 3.x</a></li>
    <li><a href="index.php?id=23" title="Welcome" >Welcome</a></li>
    <li class="last"><a href="http://google.co.uk" title="Test Web Link" >Test Web Link</a></li>
    
    
    
    		</div>
    	</div>
    	<!-- ########################### NAV END ########################### -->
    



    The last 3 li's are:

    <li><a href="index.php?id=12" title="Away3D 3.x" >Away3D 3.x</a></li>

    Is setup as a category with no sub items (this will never happen).


    <li><a href="index.php?id=23" title="Welcome" >Welcome</a></li>

    Is setup as a page using the desired template, appears to be no way to style it via a snippet

    <li class="last"><a href="http://google.co.uk" title="Test Web Link" >Test Web Link</a></li>

    Is a resource link, but there is no way to style it using a snippet
      • 41972
      • 9 Posts
      ok.. cheers for your help froga, but I think I will look into modifying Wayfinder, strip it down to how it queries modx resources and how it handles templating with chunks and hook it up with something a bit more logical:

      1. ContainerChunk
      2. Tier1SingleParentChunk
      3. Tier1ParentChunk
      4. Tier1Child
      5. Tier2SingleParentChunk
      6. Tier2ParentChunk
      7. Tier2Child
      8. Category (Category output limitation - to allow for output only where resources fall under a certain category)


      Thanks

      D
        • 10208 ☆ A M B ☆
        • 1,780 Posts
        Smarter people than I do exist, and they know Wayfinder far better than I, and can actually help you. I think they're sleeping, or hustling to get ready for MODXpo in Utrecht. The past couple weeks, it's been a little slow here because all the really smart MODX peeps are just too busy.


        Ottogal has a Wayfinder demo that you might find useful, and Susan Sottwell's site is also chock full of information and tips.

        http://calidris.de/ottogal/ymodx/index.php?lang=en
        http://sottwell.com/how-modx-works.html


          Frogabog- MODX Websites in Portland Oregon
          "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
          Having server issues? These guys have MODX Hosting perfected - SkyToaster
          • 22427
          • 793 Posts
          I will look into modifying Wayfinder
          I would not recommend this. What you want to achieve should be possible using the Wayfinder template properties.

          My wayfinder call looks like so:

          [[Wayfinder? &startId=`0` &level=`2`
          &hereTpl=`wfHereTpl`
          &outerTpl=`wfOuter`
          &innerTpl=`wfInner`
          &innerRowTpl=`wfInnerRowTpl`
          &innerHereTpl=`wfInnerHereTpl`
          &parentRowTpl=`wfParentRow`
          &parentRowHereTpl=`wfParentRowHereTpl`
          &categoryFoldersTpl=`wfCategoryFoldersTpl`
          ]]
          Most likely we could give a better help knowing the code of these chunks.
            • 41972
            • 9 Posts
            @ottogal
            It works fine for when there are nested items in a menu, however it doesn't work when the root menu item is a solid link (see page 1 of this thread).

            Modifying wayfinder seems ok, only problem I'm having with it is finding why it caches the template tags from the command string (&innerRowTpl). There are a couple of condition statements checking when to use the appropriate tpl, so extending this should be fine. And the has children calculation has already been done, I just need to find out how to get my own tags into it, thing seems to be caching all the time (even after menu clear site cache and deleting all cache folders too lol).

            Also wayfinder seems to strip out huge amounts of data which never gets used. This addon could use some serious attention. XML / JSON navigation trees would also be useful to generate - could patch it in with AngularJS, Flash etc then.

            I will probably just patch in additional tags and remove the existing ones, once I find where it is caching the snippet file.

            But in the mean time I am I will quickly rework a standard nested li tree output from wayfinder via javascript to generate the html structure that I need (jquery, underscore & backbone are already plugged in). [ed. note: darcey last edited this post 13 years, 11 months ago.]
              • 41972
              • 9 Posts
              UPDATE:
              For anyone else wishing to have multi level wrapped navigational items simply modify:

              1. core/components/wayfinder/wayfinder.class.php - outerTpl for your outer, tier1 and tier2 wrappers and adjust/add template if statements to output your templates at the desired condition
              2. core/components/wayfinder/wayfinder.snippet.php - $wf->_templates = array
              Add your own template params here
              3. Due to caching issues (point 2 will not reflect changes on the site), once you made changes here copy them to file core/cache/includes/elements/modsnippet/1.indluce.cache.php - Even if you delete this file it will regenerate as the pre-installed version of wayfinder - reason - not clear to me at this time