Other: Navigation buttons

Maintained by DavoDavo Smith
Add customisable navigation buttons (next/prev/etc.) to the bottom of each activity page (Moodle 1.9/2.0+)
375 sites
22 fans
Moodle 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4

Travis build status

Navigation buttons (for Moodle 1.9 / 2.0+)
This block adds customisable navigation buttons (first/previous/next/etc.) to the bottom of each activity/resource page in a course.

It is based on an idea from Penny Mondani: http://pennymondani.com
Thanks also to the US company that sponsored the development, who wish to remain anonymous.


  1. Download the file and unzip it somewhere convenient.
  2. On your server, in the 'blocks' folder, create a subfolder called 'navbuttons'
  3. Upload all the files inside the 'davosmith-moodle-navbuttons-???????' folder to this new 'navbuttons' folder on your server.
  4. Log in to your Moodle site as an administrator and click on the 'Notifications' option in the Admin settings block.
  5. You need to make a small change to one Moodle core file to make this work (the change is different between Moodle 1.9 & Moodle 2.0 - see the included README.txt for details).
  6. Add the block to a course (turn editing on, select 'Navigation Buttons' from the 'Blocks - Add' menu)
  7. Customise the button appearance by clicking on 'Edit the Navigation Button settings' in the newly created block.
  8. Check the message at the bottom of the screen (under the 'Save changes' button) - it should read "Navbuttons self-test: required core modifications have been completed successfully". If not, then go back to step 5 above and check carefully.

Note: The block is only visible to users who are able to edit courses modules. Deleting the block will remove the navigation buttons (they can also be disabled through the settings).

For a quick demo, there is a screencast available here:


Screenshot #0


Davo Smith (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of Angela Cristina Contreras
    Fri, May 25, 2018, 4:26 AM
    Hi Davo!
    I have a question about the plugin. When I click on Navigation Button settings, I see this message: Navbutton self-test: The line "$output = draw_navbuttons().$this->container_end_all(true);" has not been correctly added to outputrenderers.php - see README.txt for further instructions.

    Can you helpme to fix this? I really want to use your plugin.

  • Davo
    Fri, May 25, 2018, 4:51 AM
    Hi Angela,

    Have you read through the README.txt file included with this plugin (as it suggests in the error message)? If so, is there a particular bit of the instructions that you are struggling with?
  • Picture of Chye Siaw
    Sun, Jun 3, 2018, 6:25 PM
    A note for users using Adaptable theme, The line "$output = $this->container_end_all(true);" is located in :


    It's on line 1467 (but obviously this may change as the theme version changes).
  • Picture of Sebastian Imhof
    Wed, Aug 29, 2018, 4:02 PM
    Hi Davo,
    since weve updated our test-system to moodle 3.5 we have some trouble with the Plugin.

    Our problem is, that we get an error when we try to change the "Buttons-type" to "Text" or "Simplified text:
    Fehler: Argument 1 passed to file_get_all_files_in_draftarea() must be of the type integer, null given, called in [dirroot]/lib/form/filemanager.php on line 336

    All the other settings can be edited without getting that error...

    Is there a solution for this error?

    Thanks in advance!
  • Davo
    Thu, Sep 6, 2018, 4:12 AM
    Hi Sebastian,

    I've had a quick look at this, but I've not been able to reproduce the error with my plugin and Moodle 3.5. Looking at the code, I can't find a function file_get_all_files_in_draftarea() - the closet I can see is file_get_draftarea_files().

    I'm afraid that without being to reproduce this locally, I can't really offer any insight as to what might be going wrong. If you were able to offer any extra details or some step-by-step instructions about how to reproduce this on a clean installation of Moodle 3.5, then I might be able to offer a fix.

  • Picture of Sebastian Imhof
    Mon, Sep 17, 2018, 4:22 PM
    Hi Davo,
    i haven't tried to reproduce this error on a clean moodle yet, but i can find the function "file_get_all_files_in_draftarea()" in my "filemanager.php".

    Here is the class with the function/error inside (line 302):

    Maybe this helps you to understand what the problem is.

    But I guess this error is caused by one or more updated plugins which don't like each other...
    On the live-system, which runs moodle 3.4 and the same plugins, you're plugin works well.

  • Picture of Sebastian Imhof
    Wed, Sep 26, 2018, 3:00 PM
    Hi Davo,
    the Plugin works now!

    After the moodle update from 3.5.1 to 3.5.2+ it works.

  • Picture of Chye Siaw
    Fri, Sep 28, 2018, 5:42 PM
    Hi, whenever we update our moodle, this plugin does not seem to carry over to the new version. As a result we have to re-add the navbutton block to every course each time we update moodle.

    Is there something we should be doing instead? How do we make the navbutton blocks for each course carry over to the new moodle?

    Also, is there a way to change the default icons on navbuttons? We tried replacing the png files in moodle/blocks/navbuttons/pix but it doesn't do anything. As we need to add the block to each course, then add our own icons for each block, this seems to be taking more effort than it should have. Is there an easier way to do it?
  • Davo
    Fri, Sep 28, 2018, 5:51 PM
    Hi Chye Siaw,

    I can think of no reason why the block would need adding to every course when upgrading - certainly my local test copy of Moodle has been upgraded a great many times without ever needing to do this.

    Replacing the blocks/navbuttons/pix/* files is the correct way to change the default icons - if that doesn't change anything, then you need to clear your site or browser cache to see the difference.

    Ideally if I was rewriting this plugin now, I'd introduce a better way of handling configuration across multiple courses, but it was written a long time ago and I'm unlikely to overhaul it anytime soon.
  • Picture of darwin palma
    Tue, Nov 20, 2018, 1:10 AM
    Hello, is there any way to set by default the block at every course in the site?
  • Davo
    Tue, Nov 20, 2018, 1:11 AM
    Darwin - sorry that is not currently possible.
  • Picture of Abdul Ghaffar
    Mon, Apr 1, 2019, 9:21 PM
    Hi, we are using navbuttons release = '2.2+ (Build: 2017100900)' in our project. We need to be VPAT and ADA compliant however below is an issue that needs to be resolved:
    Issue: Form control label is missing text (Next activity button) < label class = "lblNavigationButton branchbuttoncontainer" style= "z-index: 2147483646; position: relative;" >< input type = "submit" n ame = "navbutton" value = "Next activity: Is Everyone Drinking?" style = "" > label >
    Recommendation: Add the text for the form element within the label-tag or WAI-ARIA 'aria-label' or 'aria-labelledby' attribute that is already present.

    I think above code is being generated from file '"moodle/blocks/navbuttons/footer.php"'
    Please advise.
  • Davo
    Thu, Apr 4, 2019, 2:43 AM
    Hi Abdul,

    Just to confirm - the buttons are output by the make_navbutton() function in footer.php. If you want to add extra output on your site, then that is the function you'll need to edit, in order to add the label you want.

  • Picture of Abdul Ghaffar
    Fri, Oct 18, 2019, 12:24 PM
    Hi Davo,
    I have upgraded my Moodle from 3.3.3 to 3.7.2 . And also updated navbuttons from '2.2+ (Build: 2017100900)' to $plugin->version = 2018042100;
    $plugin->release = '3.4+ (Build: 2017100900)';

    In file moodle/blocks/navbuttons/activityready.php, there is a method

    * @param $cm
    * @return bool
    function navbuttons_mod_questionnaire_showbuttons($cm) {
    global $USER, $DB;
    return $DB->record_exists('questionnaire_attempts', array(
    'qid' => $cm->instance,
    'userid' => $USER->id

    As per my knowledge, 'questionnaire_attempts' table has been removed, have a look at https://moodle.org/mod/forum/discuss.php?d=392394 . I am getting exception due to this.
  • Davo
    Fri, Oct 18, 2019, 3:00 PM
    Hi Abdul,

    I've just pushed a fix to github that should address that problem (it will simply show the buttons always, rather than waiting until you have submitted an attempt).

    As an alternative, you could simply change the settings for the navbuttons (on the global settings page, not the per-course settings), so that they are set to 'Always show' or 'Show when complete' for questionnaires, instead of 'when questionnaire submitted'.
1 2 3 4 5 6 7 8 9
Please login to post comments