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

Add existing class attributes to Boost flat navigation nodes

    XMLWordPrintable

    Details

    • Testing Instructions:
      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  
    • Affected Branches:
      MOODLE_32_STABLE, MOODLE_33_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
    • Fixed Branches:
      MOODLE_37_STABLE, MOODLE_38_STABLE
    • Pull from Repository:
    • Pull 3.7 Branch:
    • Pull 3.8 Branch:
    • Pull Master Branch:
      MDL-58964-master

      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

              Assignee:
              abias Alexander Bias
              Reporter:
              abias Alexander Bias
              Peer reviewer:
              Kathrin Osswald
              Integrator:
              Sara Arjona (@sarjona)
              Tester:
              Janelle Barcega
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Bas Brands
              Votes:
              3 Vote for this issue
              Watchers:
              17 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                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