Menu Items - layer rules

Navigation, INavigationFilter, Rules

Introduction

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.

Download Package


Aim

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

  1. Download and install
  2. 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.
  3. Create new menu items
  4. Use the layer part as you would with the layer settings for widgets.

Part settings

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.

On Jun 9 2013 2:19 AMBy admin