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

Boost: Expose navigation node properties in the boost flat navigation items

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.4
    • Fix Version/s: 3.4
    • Component/s: Themes
    • Labels:
    • Testing Instructions:
      Hide

      Without patch:

      • Login as Moodle user
      • Open the web inspector tool of your choice
      • Have a look at the Dashboard node in the nav drawer. It should say:

        <a class="list-group-item list-group-item-action font-weight-bold" href="https://yourmoodle/my/" data-key="myhome" id="yui_3_17_2_1_1500282169141_75">
                        <div class="m-l-0" id="yui_3_17_2_1_1500282169141_74">
                                Dashboard
                        </div>
                    </a>
        

      • Have a look at the MyCourses node in the nav drawer. It should say:

        <div class="list-group-item" data-key="mycourses" id="yui_3_17_2_1_1500282169141_77">
                        <div class="m-l-0" id="yui_3_17_2_1_1500282169141_76">
                            My courses
                        </div>
                    </div>
        

      • Have a look at a course node within the MyCourses list in the nav drawer. It should say:

        <a class="list-group-item list-group-item-action " href="https://yourmoodle/course/view.php?id=5347" data-key="5347" id="yui_3_17_2_1_1500282169141_78">
                        <div class="m-l-1" id="yui_3_17_2_1_1500282169141_95">
                                Course
                        </div>
                    </a>
        

      With patch:

      • Login as Moodle user
      • Open the web inspector tool of your choice
      • Have a look at the Dashboard node in the nav drawer. Note the additional data-attributes which should say:

        <a class="list-group-item list-group-item-action font-weight-bold" href="https://yourmoodle/my/" data-key="myhome" data-isexpandable="0" data-indent="0" data-showdivider="0" data-type="1" data-nodetype="1" data-collapse="0" data-forceopen="1" data-isactive="1" data-hidden="0" data-preceedwithhr="0" id="yui_3_17_2_1_1500282169141_75">
                        <div class="m-l-0" id="yui_3_17_2_1_1500282169141_74">
                                Dashboard
                        </div>
                    </a>
        

      • Have a look at the MyCourses node in the nav drawer. Note the additional data-attributes which should say:

        <div class="list-group-item" data-key="mycourses" data-isexpandable="1" data-indent="0" data-showdivider="0" data-type="0" data-nodetype="1" data-collapse="0" data-forceopen="1" data-isactive="0" data-hidden="0" data-preceedwithhr="0" data-parent-key="myhome" id="yui_3_17_2_1_1500282169141_77">
                        <div class="m-l-0" id="yui_3_17_2_1_1500282169141_76">
                            Meine Kurse
                        </div>
                    </div>
        

      • Have a look at a course node within the MyCourses list in the nav drawer. Note the additional data-attributes which should say:

        <a class="list-group-item list-group-item-action " href="https://yourmoodle/course/view.php?id=5347" data-key="5347" data-isexpandable="1" data-indent="1" data-showdivider="0" data-type="20" data-nodetype="1" data-collapse="0" data-forceopen="0" data-isactive="0" data-hidden="0" data-preceedwithhr="0" data-parent-key="mycourses" id="yui_3_17_2_1_1500282169141_78">
                        <div class="m-l-1" id="yui_3_17_2_1_1500282169141_95">
                                Course
                        </div>
                    </a>
        

      Show
      Without patch: Login as Moodle user Open the web inspector tool of your choice Have a look at the Dashboard node in the nav drawer. It should say: <a class="list-group-item list-group-item-action font-weight-bold" href="https://yourmoodle/my/" data-key="myhome" id="yui_3_17_2_1_1500282169141_75"> <div class="m-l-0" id="yui_3_17_2_1_1500282169141_74"> Dashboard </div> </a> Have a look at the MyCourses node in the nav drawer. It should say: <div class="list-group-item" data-key="mycourses" id="yui_3_17_2_1_1500282169141_77"> <div class="m-l-0" id="yui_3_17_2_1_1500282169141_76"> My courses </div> </div> Have a look at a course node within the MyCourses list in the nav drawer. It should say: <a class="list-group-item list-group-item-action " href="https://yourmoodle/course/view.php?id=5347" data-key="5347" id="yui_3_17_2_1_1500282169141_78"> <div class="m-l-1" id="yui_3_17_2_1_1500282169141_95"> Course </div> </a> With patch: Login as Moodle user Open the web inspector tool of your choice Have a look at the Dashboard node in the nav drawer. Note the additional data-attributes which should say: <a class="list-group-item list-group-item-action font-weight-bold" href="https://yourmoodle/my/" data-key="myhome" data-isexpandable="0" data-indent="0" data-showdivider="0" data-type="1" data-nodetype="1" data-collapse="0" data-forceopen="1" data-isactive="1" data-hidden="0" data-preceedwithhr="0" id="yui_3_17_2_1_1500282169141_75"> <div class="m-l-0" id="yui_3_17_2_1_1500282169141_74"> Dashboard </div> </a> Have a look at the MyCourses node in the nav drawer. Note the additional data-attributes which should say: <div class="list-group-item" data-key="mycourses" data-isexpandable="1" data-indent="0" data-showdivider="0" data-type="0" data-nodetype="1" data-collapse="0" data-forceopen="1" data-isactive="0" data-hidden="0" data-preceedwithhr="0" data-parent-key="myhome" id="yui_3_17_2_1_1500282169141_77"> <div class="m-l-0" id="yui_3_17_2_1_1500282169141_76"> Meine Kurse </div> </div> Have a look at a course node within the MyCourses list in the nav drawer. Note the additional data-attributes which should say: <a class="list-group-item list-group-item-action " href="https://yourmoodle/course/view.php?id=5347" data-key="5347" data-isexpandable="1" data-indent="1" data-showdivider="0" data-type="20" data-nodetype="1" data-collapse="0" data-forceopen="0" data-isactive="0" data-hidden="0" data-preceedwithhr="0" data-parent-key="mycourses" id="yui_3_17_2_1_1500282169141_78"> <div class="m-l-1" id="yui_3_17_2_1_1500282169141_95"> Course </div> </a>
    • Affected Branches:
      MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-59425-master

      Description

      Even if we don't use the attributes - it would allow plugin developers to enhance the boost navigation in a structured way if they had access to the properties of the flat_navigation_nodes in the dom. We can just add data-attributes for these even if they are not used in core.

      List of properties:

      indent, showdivider, key (already done), type, nodetype, collapse, forceopen, isactive, hidden, preceedwithhr, isexpandable.

      This is not a complete list, the others are either too specific or to general. Classes in particular should not be exposed because any use of classes outside of the "view" is bad practice. 

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              abias Alexander Bias
              Reporter:
              damyon Damyon Wiese
              Peer reviewer:
              Damyon Wiese Damyon Wiese
              Integrator:
              Dan Poltawski Dan Poltawski
              Tester:
              Marina Glancy Marina Glancy
              Participants:
              Component watchers:
              Bas Brands
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                13/Nov/17