Creating a Menu Bar from Spry Nested Data

Most Spry Widgets can be created from Spry Data. Due to the nested list structure used with the Menu Bar widget, Spry Nested data sets are a good way to generate dynamic Menu Bars.

Simple Version

This version is the minimum code required to output a Menu. This does not take into account a menu item with no submenu(Buttermilk).





No Submenu

There are instances where some menu items do not have submenus. This sample has extra code to detect this and write out the correct code.

 

 

Important Note: Due to how the Menu Bar applies styles, you should use the Observer method to activate the widget.