Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-55256

Add unique key class to tree navigation block

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Development in progress
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.1
    • Fix Version/s: None
    • Component/s: Navigation
    • Labels:
      None
    • Testing Instructions:
      Hide
      1. Navigate into any course.
      2. Use "Inspect element" on the "Participants" menu item inside the Navigation block, and make sure that it has a class with the following format "key-participants".
      3. Similar to the above instructions, check that a course menu item has a class with the following format "courseid-[courseid]".
      4. Go thought the course administration Settings block and make sure each node has a unique english class with the following format "key-[node-name]".
      Show
      Navigate into any course. Use "Inspect element" on the "Participants" menu item inside the Navigation block, and make sure that it has a class with the following format "key-participants". Similar to the above instructions, check that a course menu item has a class with the following format "courseid- [courseid] ". Go thought the course administration Settings block and make sure each node has a unique english class with the following format "key- [node-name] ".
    • Affected Branches:
      MOODLE_31_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-55256_master

      Description

      While trying to make some user UI pedagogical tutorials/tours (using local_usertour) I find a need to use unique and meaningful classes for most of the navigation (block) nodes.
      Trying to use the node unique id attribute is not so helpful, as it is unique (but not so meaningful) to that specific generate page at that time, and I am looking for a class name that is unique on the page but also persistent across courses (for example) like the "grades" node.

      Current state, before fix:

      <p class="tree_item branch" role="treeitem" aria-expanded="false" aria-owns="578a3c9373182_group" 
      tabindex="0" aria-selected="true" id="yui_3_17_2_1_1468677269779_347">
      <a tabindex="-1" id="label_4_15" href="http://localhost/moodle-org/master/user/index.php?id=2">participants</a></p>
      

      After fix (see new class "key-participants"):

      <p class="tree_item branch key-participants" role="treeitem" aria-expanded="false" aria-owns="578a3c9373182_group" 
      tabindex="0" aria-selected="true" id="yui_3_17_2_1_1468677269779_347">
      <a tabindex="-1" id="label_4_15" href="http://localhost/moodle-org/master/user/index.php?id=2">participants</a></p>
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: