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
Current versions available: 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


  • Picture of Ketan Chandaria
    Mon, Nov 27, 2017, 4:27 PM
    No worries Davo
    If you have any documentation then i can help look into it and let you know if i succeed so you can then add it to the plugin.
  • Davo
    Mon, Nov 27, 2017, 4:30 PM
    Ketan, I'm not quite sure what documentation you are after - there's developer docs over at: https://docs.moodle.org/dev/Main_Page . My plugin code has some comments in it, but I've not got a full range of technical documentation for it.
  • Picture of Sheila Owen
    Fri, Dec 1, 2017, 6:55 PM
    Hi Davo. Great plugin! Is there any way to place the nav buttons at the top of the page, within the navbar section, rather than the footer?
  • Davo
    Fri, Dec 1, 2017, 6:58 PM
    Sheila, I guess you could insert the core hack to output the buttons into a different place in the code to output them to a different place on the page. Probably somewhere in the header() function, but I couldn't tell you exactly where.
  • Picture of Sheila Owen
    Fri, Dec 1, 2017, 7:42 PM
    Cool. Thanks. I'll give that a go.
  • Picture of Sheila Owen
    Fri, Dec 1, 2017, 9:13 PM
    I haven't found where to put the code yet. I tried a few places but it didn't render. It's late here now, so I'll try again tomorrow. In the meantime, if anyone can think of how I can get the buttons in the top navbar area (in course pages only) I'd be happy for your input ...
  • Picture of Inter Jos
    Tue, Dec 5, 2017, 1:04 AM
    Hi Davo, I want to delete the plugin but when I do that (remove the navbutton map or remove it from the plugin page within moodle) i get this error:

    Warning: require_once(/.../moodledir/blocks/navbuttons/footer.php): failed to open stream: No such file or directory in /.../moodledir/lib/outputrenderers.php on line 1283

    Fatal error: require_once(): Failed opening required '/.../moodledir/blocks/navbuttons/footer.php' (include_path='/.../moodledir/lib/pear:.:/usr/local/php70/pear') in /.../moodledir/lib/outputrenderers.php on line 1283

    How can I safely uninstall the navigation buttons?

  • Davo
    Tue, Dec 5, 2017, 1:06 AM
    Jose - just reverse the changes to outputrenderers.php that you made whilst installing the plugin (for reference, the instructions are here: https://github.com/davosmith/moodle-navbuttons/blob/master/README.txt#L35 )
  • Picture of Inter Jos
    Tue, Dec 5, 2017, 1:24 AM
    that's it, I forgot I changed that file. Works now, thanks.
  • Picture of marisol castro
    Thu, Dec 21, 2017, 5:45 AM
    Hi Davo,

    I modified the outputrenders.php file as instructed in the readme file but mine still does not work. I am running Moodle 3.3 with the Adaptable 1.5.3 theme.

    The output says 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

    This is what I put in the php file:

    public function footer() {
    global $CFG, $DB, $PAGE;

    // Give plugins an opportunity to touch the page before JS is finalized.
    $pluginswithfunction = get_plugins_with_function('before_footer', 'lib.php');
    foreach ($pluginswithfunction as $plugins) {
    foreach ($plugins as $function) {

    require_once ($CFG->dirroot.'/blocks/navbuttons/footer.php');
    $output = draw_navbuttons().$this->container_end_all(true); {
    // Change this line to enable the navigation buttons

    $footer = $this->opencontainers->pop('header/footer');

    Am I missing something? Please help. Thanks!
  • Davo
    Thu, Dec 21, 2017, 3:01 PM
    Please switch to one of the standard themes (boost or clean) and see if it works. If it does, then to get it working with essential, you'll need to find where that theme overrides the 'footer()' function and add the core change there instead.
  • Picture of Jesse F.
    Fri, Mar 23, 2018, 6:21 AM
    Sidenote. If you're using the essential theme, the line of code you need is in: public_html/theme/essential/classes/output/core_renderer.php
  • Picture of Stewart Carswell
    Tue, May 15, 2018, 4:43 PM
    Hi Davo, I think there's an error in the latest zip folder. For the plugin version 3.4+ (Build: 2017100900) (2018042100), when I click the green download link, the zip folder that I download is completely empty.
  • Davo
    Wed, May 16, 2018, 3:46 AM
    Thanks Stewart - it's a problem with the github import not working properly as the plugin has been moved into the 'other' category, rather than the 'blocks' category (which breaks a lot of features of the plugins DB). Unfortunately, the plugin still needs a tiny core (or theme) modification to work, so it doesn't get to go anywhere else ...
  • Davo
    Wed, May 16, 2018, 3:46 AM
    (I have now manually fixed the download).
Please login to post comments