I have completed most of the work on the new menu builder WayFinder. I have attached the snippet and would love for anyone who has time to give it a good run through. It now uses templates for output and they are required, so read through the doc at the top to get a feel for how it is used.
The one feature that still needs added is the category folders, and I will be working on that soon. I am also thinking of adding a variable to set a css chunk to be included. Then with the chunk use a regclientcss to add it to the page so we could release full menu templates with the chunks and css all in one package.
I also plan on doing some timing tests to see how it compares to the original dropmenu.
So give it a whirl and let me know if there are any bugs or additional features I missed.
Kyle
Edit - I have updated the files with Jasons suggestions, you must create a folder under assets/snippets named wayfinder and put the file wayfinder.inc.php in there. I tested it with php4 + php5 and is working correctly now.
Edit - 07/15/06 - Fixed error of not adding submenus if at end of menu.
Edit - 07/16/06 - If no innerHereTpl chunk specified uses hereTpl if specified
Is this a successor of DropMenu ?
-
MODX Staff
- 10,725 Posts
There is no reason for a singleton to be used here. So first, get rid of the static $instance and the getInstance() function. Next, I suggest making this snippet include_once the class as an external file. This will increase performance with multiple uses per request, and will also allow it to take full-advantage of opcode caching systems when employed. The snippet should simply contain the instance of the class, the default settings and ability to override those with snippet parameters, then execute the main function to render the menu to screen or placeholder, or whatever...
Man you guys are fast! I’m busy for 2 days, come back and this is already finished!
aour,
try re-adding the snippet. there is a php tag in the comments on line one and am wondering if that got uncommented when you copied it in.