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

Add unique key class to tree navigation block

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 3.1
    • Navigation
    • None
    • MOODLE_31_STABLE
    • MDL-55256_master
    • 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] ".

      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>
      

            nadavkav Nadav Kavalerchik
            nadavkav Nadav Kavalerchik
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.