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

SimpleNavigationTag showing empty <ul> when no visible children

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • Minor
    • None
    • 2.1 Final
    • taglibs
    • None

    Description

      When displaying the navigation for elements that have children and if all the elements' children are set to hideInNav, an empty ul: <ul class="levelx"></ul> is shown. In CSS drop-down navigation menus, this displays as an empty block, but also it is syntactically incorrect HTML. This is only a problem for elements which are located anywhere in the branch of a selected element. E.g. In the tree

      Home
      + Section 1
      ...
      + Section 2
      + Subsection 2.1
      + Subsection 2.2
      + Page 2.2.1
      + Page 2.2.2
      + Page 2.2.3
      + Subsection 2.3
      + Page 2.3.1
      + Page 2.3.2
      + Page 2.3.3
      ...

      Pages under 2.2 are marked as hideInNav; if Page 2.2.1 is selected so is the currently active page, then an empty ul element is created.

      Having looked at the code, I reckon the fix is here (line 249):

      if (activePage.getHandle().equals(child.getHandle())) {
      // self
      // check if child has visible children
      if (hasVisibleChildren(child))

      { showChildren = true; }

      self = true;
      cssClasses.add("active"); //$NON-NLS-1$
      }

      It hasn't been tested.

      John

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              pbaerfuss Philipp Bärfuss
              johnolival John Olival
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Bug DoR
                  Task DoD