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

Add "first" to li class on first element, "last" to li class on last element of level

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 4.0
    • 3.6.3
    • taglibs
    • Yes

      Often one would like to have the first or last nav element of a level display differently, e.g. an additional border. The proposed modification adds a "first" to the css class of the first element and a "last" to the last nav element of each level, i.e. to the <li> tag.

      For instance this:
      <ul class="level3">
      <li class="leaf"><a href="/magnoliaAuthor/page1.html">Link 1</a></li>
      <li class="leaf"><a href="/magnoliaAuthor/page2.html">Link 2</a></li>
      <li class="leaf"><a href="/magnoliaAuthor/page3.html">Link 3</a></li>
      <li class="leaf"><a href="/magnoliaAuthor/page4.html">Link 4</a></li>
      </ul>

      will be turned into this:
      <ul class="level3">
      <li class="leaf first"><a href="/magnoliaAuthor/page1.html">Link 1</a></li>
      <li class="leaf"><a href="/magnoliaAuthor/page2.html">Link 2</a></li>
      <li class="leaf"><a href="/magnoliaAuthor/page3.html">Link 3</a></li>
      <li class="leaf last"><a href="/magnoliaAuthor/page4.html">Link 4</a></li>
      </ul>

      Note: I did create the patch file as described in http://wiki.magnolia-cms.com/display/WIKI/Developer+information but the patch file looks strange with many many lines to be removed. Therefore I also added the complete, modified Java file.

        Acceptance criteria

              gjoseph Magnolia International
              will Will Scheidegger
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoD

                    Estimated:
                    Original Estimate - 0.5h
                    0.5h
                    Remaining:
                    Remaining Estimate - 0.5h
                    0.5h
                    Logged:
                    Time Spent - Not Specified
                    Not Specified