We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33983 ☆ A M B ☆
    • 181 Posts
    Check it out: https://github.com/jgulledge19/MenuBuilder and run a few test.

    MenuBuilder is in development and ready for some testing. MB also aims to be a relevant alternative/replacement for Wayfinder.

    Some Features
    - Use different Chunks for every level of your menu if you choose
    - Currently loads one or all menus with a single query, should be fast
    - Simpler design and usage, faster to get up and going and more flexible.
    [ed. note: jgulledge19 last edited this post 10 years, 11 months ago.]
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      It's always nice to have more than one or two ways to do things, but what advantage does this have over Wayfinder or pdoMenu?
        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
        • 33983 ☆ A M B ☆
        • 181 Posts
        @sottwell, I have only one instance of pdoMenu and have not spent much time with it, but I do have an error with it that instance I have not had time to fix. As for Wayfinder I have used a fair amount so I will list what I would say are the major differences.

        1. Performance, see the iterateType Property, if PDO is set in a simple test it seems to take about half the time to load verses Wayfinder/getIterator. When set with PDO and used with the default Chunks, so not set via properties it is more than 4 times faster, 700ms vs 170ms. It seems to be marginally faster when set to getIterator which is the default. Note if you need columns/TVs processed then you will need to use the getIterator value. I did just a simple test with about 315 resource list generated.
        2. Easier to set up and customize, in my opinion anyway. There are only two Chunks used, a chunkWrapper and an chunkItem. If you want to have different chunk(s) for different levels simple add a the level number that you wish to override, example for item level#2:
        &chunkItem2=`myNavChunkItemLevel2`


        I still have some work to do regarding generating classes and setting a placeholder in the Wrapper/Item for Active/ActiveParent as a bool. Also I just made another commit to fix the docs and a small bug and have not implemented all Wayfinder features, not sure I will.

        Comparison Example:
        MenuBuilder:
        [[!menuBuilder?
         &startId=`0`
         &chunkItem=`mbItemTest`
         &chunkWrapper=`mbWrapperTest`
         &debug=`0`
         &limit=`1000`
        ]]
        
        // mbItemTest Chunk:
        <li>
        	Count: [[+mbCount]] | Level: [[+mbLevel]] <a href="[[+mbUrl]]" class="[[+mbItemClasses]]">[[+mbTitle]]</a>
        	[[+mbChildren]]
        </li>
        
        // mbWrapper Chunk:
        <ul class="[[+mbClasses]]">
          Count: [[+mbCount]] | Level: [[+mbLevel]]
          [[+mbChildren]]
        </ul>
        
        


        Wayfinder:

        [[!wayfinder?
         &startId=`0`
         &rowTpl=`wfItemTest`
         &outerTpl=`wfWrapperTest`
         &debug=`0`
         &limit=`1000`
        ]]
        
        // wfItemTest Chunk:
        <li[[+wf.id]][[+wf.classes]]>
          Count: -- | Level: [[+wf.level]] 
          <a href="[[+wf.link]]" title="[[+wf.title]]" [[+wf.attributes]]>[[+wf.linktext]]</a>
          [[+wf.wrapper]]
        </li>
        
        // wfWrapper Chunk:
        <ul[[+wf.classes]]>
          Count: -- | Level: --
          [[+wf.wrapper]]
        </ul>
        
        

        • discuss.answer
          • 33983 ☆ A M B ☆
          • 181 Posts
          @sottwell, I just did a little more testing, I have not yet added in a caching option. Wayfinders caching option makes it faster then when the iterateType Property is set to getIterator, but still slower then when it is set to PDO.