Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-2053

Possibilty to treat specified startLevel and endLevel as relative to active page

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.6.2, 3.6.3
    • 3.5.4
    • taglibs
    • None
    • Yes

      In some cases, it is desirable to have a SimpleNavigation that always shows the children of a given page, or that always shows the siblings of a given page. SimpleNavigation currently specifies the startLevel and endLevel in absolute terms.

      The attached patch adds an optional attribute to the SimpleNavigation tag that allows you to specifiy the way the levels are handled. I called it "levelHandlingMode" for lack of a better name, and when it is set to "relative" the behavior is changed slightly. At the start of the doEndTag, it does this:

      if (this.levelHandlingMode.equals(LEVEL_MODE_RELATIVE)) {
      this.startLevel += activePageLevel;
      this.endLevel += activePageLevel;
      }

      This simple change at the beginning of the doEndTag will allow you to specify negative values for the start value or end value, and have it work appropriately.

      I've tested it for the use case that I wanted it to work for, and it works properly... and, most importantly, it doesn't break any existing functionality.

        Acceptance criteria

              gjoseph Magnolia International
              ryangardner Ryan Gardner
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoD