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

Allow full customisation of the primary navigation

    XMLWordPrintable

Details

    • MOODLE_400_STABLE
    • MOODLE_400_STABLE
    • MDL-74033-master-2
    • Hide
      • Edit theme/boost/config.php and add the following line at the end of the file

        $THEME->removedprimarynavitems = ['home', 'myhome', 'courses', 'siteadminnode'];

      • Log in as admin
      • Press Tab several times
      • Verify that the first element that is focused after the site name (or site logo if you have one) is the search element (or the notification icon if search isn't enabled)
      • Edit theme/boost/config.php again and update the modified line to

        $THEME->removedprimarynavitems = ['home', 'myhome', 'courses'];

      • Refresh the page
      • Verify that you only see a single item (Site administration) in the primary navigation bar
      • Press Tab several times
      • Verify that the first element that is focused after the site name (or site logo if you have one) is the "Site administration" element in the primary navigation
      • Go to "Site administration > Appearance > Themes > Theme settings"
      • Set "Custom menu items" to the following and then save changes

        Courses
        -All courses|/course/
        -Course search|/course/search.php
        -###
        -FAQ|https://someurl.xyz/faq
        -Preguntas más frecuentes|https://someurl.xyz/pmf||es
        Mobile app|https://someurl.xyz/app|Download our app
        

      • Verify that you see "Site administration", "Courses", "Mobile app" in the primary nav bar
      • Edit theme/boost/config.php again and update the modified line to

        $THEME->removedprimarynavitems = ['home', 'myhome', 'courses', 'siteadminnode'];

      • Refresh the page
      • Verify that you see "Courses", "Mobile app" in the primary nav bar
      • Verify that none of the items in the primary nav is styled as active
      • Press Tab several times
      • Verify that the first element that is focused after the site name (or site logo if you have one) is the "Courses" element in the primary navigation

       

      Show
      Edit theme/boost/config.php and add the following line at the end of the file $THEME->removedprimarynavitems = ['home', 'myhome', 'courses', 'siteadminnode']; Log in as admin Press Tab several times Verify that the first element that is focused after the site name (or site logo if you have one) is the search element (or the notification icon if search isn't enabled) Edit theme/boost/config.php again and update the modified line to $THEME->removedprimarynavitems = ['home', 'myhome', 'courses']; Refresh the page Verify that you only see a single item (Site administration) in the primary navigation bar Press Tab several times Verify that the first element that is focused after the site name (or site logo if you have one) is the "Site administration" element in the primary navigation Go to "Site administration > Appearance > Themes > Theme settings" Set "Custom menu items" to the following and then save changes Courses -All courses|/course/ -Course search|/course/search.php -### -FAQ|https://someurl.xyz/faq -Preguntas más frecuentes|https://someurl.xyz/pmf||es Mobile app|https://someurl.xyz/app|Download our app Verify that you see "Site administration", "Courses", "Mobile app" in the primary nav bar Edit theme/boost/config.php again and update the modified line to $THEME->removedprimarynavitems = ['home', 'myhome', 'courses', 'siteadminnode']; Refresh the page Verify that you see "Courses", "Mobile app" in the primary nav bar Verify that none of the items in the primary nav is styled as active Press Tab several times Verify that the first element that is focused after the site name (or site logo if you have one) is the "Courses" element in the primary navigation  
    • 1
    • HQ Team International CIH2-219

    Description

      A large number of developers have asked about the possibility of customising the primary navigation. We had an investigation into doing that in MDL-73233, but a complete solution like what is being implemented for the dashboard, is not possible for all primary navigation items in the time remaining for the 4.0 release.

      This issue is to provide a way to show and hide primary navigation nodes (tabs) in a less strict fashion. For this adding variables to theme/config.php are for developer alterations and the same internal checks are not required from core.

      The primary navigation is only visible in the boost theme, and making changes in core related to theme specifics is not allowed. So we have to work with that restriction.

      By adding a config to the boost theme, the specific layout pages can retrieve that information and then alter the primary class accordingly. We could help out here by providing a method to help.

       

      Attachments

        Issue Links

          Activity

            People

              rezaie9 Shamim Rezaie
              abgreeve Adrian Greeve
              Simey Lameze Simey Lameze
              Ilya Tregubov Ilya Tregubov
              Gladys Basiana Gladys Basiana
              Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 6 hours
                  6h

                  Clockify

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