The current navigation lacks the ability to hide individual menu items easily on the same menu group. A solution would be to create many menu sections and hide them on different menu widget layers. Instead, I have attempted to tackle this limitation by allowing each menu item to have its own rules keeping things down to the minimum amount of menus.
The targets are pretty simple:
- Show or hide different menu items determined by route - Complete
- Consider hierarchy with these rules. - Complete
- ie if the menu item with path "2"'s rule is evaluated to be false then "2.1", "2.2", 2.1.1" etc will not show.
- Use the layer rules that people should already be familiar with - Complete
- Allow any of the menu item types to have rules. - Complete - attach part to menu item
This is achieved by creating a filter based on INavigationFilter and evaluating the menu item's rules and settings with the same rule manager (IRuleManager) that is used with layers.
How to use
- Download and install
- Enable the feature: "Navigation Item Layer Rules"
- This will create a new content type for the menu item. This menu item is one way of using the part.
- The layer part is attachable and has two settings
- Add the layer part to any menu item type you need the functionality.
- Create new menu items
- Use the layer part as you would with the layer settings for widgets.
The part has two settings that allow the navigation to disable the layer rules from:
- Evaluating the menu item - hide / show itself and hide any item below its level.
- Evaluating the level the menu item is on - allows the option for sub items to be shown by a different rule.
Disabling either of the two settings removes the editors as well.