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

Add existing class attributes to Boost flat navigation nodes

    XMLWordPrintable

Details

    • MOODLE_32_STABLE, MOODLE_33_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
    • MOODLE_37_STABLE, MOODLE_38_STABLE
    • MDL-58964-master
    • Hide

      Prerequisites

      1. Install the plugin local_boostnavigation from local_boostnavigation.zip into your testing instance.
      2. Login as admin
      3. Create a course C
      4. Create a user U
      5. Enrol the user U into the course C
      6. Login as user U
      7. Show the Boost nav drawer
      8. Open your browser's web inspector

      Test 1

      1. Search the MyCourses nav drawer node (which has the data-key="mycourses" attribute)
      2. Verify that this node has the classes "list-group-item mycourseclass" set. Ignore any double or trailing whitespaces in the classes list

      Test 2

      1. Search an additional nav drawer node with the label "Custom node" which is linking to /custom/node/index.php
      2. Verify that this node has the classes "list-group-item list-group-item-action foo bar" set. Ignore any double or trailing whitespaces in the classes list

      Test 3

      • Have a look at the other nav drawer nodes
      • Verify that they do not contain any other classes than list-group-item, list-group-item-action, active or active_tree_node. Ignore any double or trailing whitespaces in the classes list

       

      Show
      Prerequisites Install the plugin local_boostnavigation from local_boostnavigation.zip into your testing instance. Login as admin Create a course C Create a user U Enrol the user U into the course C Login as user U Show the Boost nav drawer Open your browser's web inspector Test 1 Search the MyCourses nav drawer node (which has the data-key="mycourses" attribute) Verify that this node has the classes "list-group-item mycourseclass" set. Ignore any double or trailing whitespaces in the classes list Test 2 Search an additional nav drawer node with the label "Custom node" which is linking to /custom/node/index.php Verify that this node has the classes "list-group-item list-group-item-action foo bar" set. Ignore any double or trailing whitespaces in the classes list Test 3 Have a look at the other nav drawer nodes Verify that they do not contain any other classes than list-group-item, list-group-item-action, active or active_tree_node. Ignore any double or trailing whitespaces in the classes list  

    Description

      Navigation node objects in the navigation tree have a "classes" attribute. With

      $node->add_class('foo');
      

      a developer is able to add additional classes to existing navigation node objects.

      Unfortunately, the flat navigation in Boost's nav drawer does not output these classes because they are not output in the mustache template.

      I propose to output these classes in Boost's flat navigation to allow developers to add additional classes to existing navigation nodes, for example within the *_extend_navigation() hook.

      I classified this ticket as bug because it's rather a bug than an improvement and thereby it can be backported to 3.2

      Attachments

        Issue Links

          Activity

            People

              abias Alexander Bias
              abias Alexander Bias
              Kathrin Osswald Kathrin Osswald
              Sara Arjona (@sarjona) Sara Arjona (@sarjona)
              Janelle Barcega Janelle Barcega
              Votes:
              3 Vote for this issue
              Watchers:
              15 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                11/May/20

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours, 30 minutes
                  2h 30m