Moodle plugins directory: Navigation buttons | Moodle.org
Navigation buttons
Blocks ::: block_navbuttons
Maintained by Davo Smith
Add customisable navigation buttons (next/prev/etc.) to the bottom of each activity page (Moodle 1.9/2.0+)
Latest release:
722 sites
223 downloads
44 fans
Current versions available: 4
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.
Installation:
- Download the file and unzip it somewhere convenient.
- On your server, in the 'blocks' folder, create a subfolder called 'navbuttons'
- Upload all the files inside the 'davosmith-moodle-navbuttons-???????' folder to this new 'navbuttons' folder on your server.
- Log in to your Moodle site as an administrator and click on the 'Notifications' option in the Admin settings block.
- If you are running a version of Moodle earlier than 3.10, 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).
- Add the block to a course (turn editing on, select 'Navigation Buttons' from the 'Blocks - Add' menu)
- Customise the button appearance by clicking on 'Edit the Navigation Button settings' in the newly created block.
- 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:
Useful links
Contributors
Davo Smith (Lead maintainer)
Please login to view contributors details and/or to contact them
in our moodle with adaptable as theme, the plugin isn't working properly. as i understand the readme file correctly, we have to change the file renderers.php from the theme folder. in this file the lines connected to the footer are:
public function get_footer_blocks($layoutrow = 'footerlayoutrow') {
global $PAGE, $OUTPUT;
$fields = array();
$blockcount = 0;
$style = '';
if (!$this->get_footer_visibility()) {
return '';
}
$output = '
for ($i = 1; $i <= 3; $i++) {
$footerrow = $layoutrow . $i;
$footerrow = $PAGE->theme->settings->$footerrow;
if ($footerrow != '0-0-0-0') {
$fields[] = $footerrow;
}
}
foreach ($fields as $field) {
$output .= '
$vals = explode('-', $field);
foreach ($vals as $val) {
if ($val > 0) {
$blockcount ++;
$footerheader = 'footer' . $blockcount . 'header';
$footercontent = 'footer' . $blockcount . 'content';
if (!empty($PAGE->theme->settings->$footercontent)) {
$output .= '
if (!empty($PAGE->theme->settings->$footerheader)) {
$output .= '
';
';$output .= $OUTPUT->get_setting($footerheader, 'format_text');
$output .= '
}
$output .= $OUTPUT->get_setting($footercontent, 'format_html');
$output .= '
}
}
}
$output .= '
}
$output .= '
return $output;
}
which line do we need to change to put these lines:
require_once($CFG->dirroot.'/blocks/navbuttons/footer.php');
$output = draw_navbuttons().$this->container_end_all(true);
thanks for any support!
i have to replace $output = $this->container_end_all(true); with $output = draw_navbuttons().$this->container_end_all(true);
where do i have to add? require_once($CFG->dirroot.'/blocks/navbuttons/footer.php');
is this correct?
$output = $this->container_end_all(true);
With the lines:
require_once($CFG->dirroot.'/blocks/navbuttons/footer.php');
$output = draw_navbuttons().$this->container_end_all(true);
But I have one question: Is there a way to DISABLE the rendering with the navigation buttons on a SPECIFIC page? I have a problem with the embed_question plugin, which generates an embedded page based upon a quiz question. Then the buttons are rendered twice, both for the embedded page and 'real' page. And the buttons for the embedded pages do not work as wanted, as they change the contents only of the embedded section.
It is probably fairly straightforward to add a specific exception to not show using embed_question, but I've not tried that plugin, so I would need to find some time to try it out and see what happens (in the meantime, I'm happy to accept a simple patch that solves this problem, if you are able to look at the code in blocks/navbuttons/footer.php).
But I really like the embedded question plugin as well, as it allows to just use ONE question from the question bank to reinforce the learning on a specific page, without the somewhat complex user interface of running a quiz (several steps: starting the quiz, submitting the quiz, confirming that you want to submit etc.).
A problem vs. the navigation buttons is that the embedded question (to my knowledge!) does not 'behave' like a quiz or any other activity type, so it is not possible to use the functionality for behavior of the navigation buttons for specific activity types. It 'just' generates portions of a web page.
I have access to the blocks/navbuttons/footer.php code, but adjusting this code is far beyond my competence in PHP. And regarding the embed_question plugin, I really do not know how use the tags that it generates in order to NOT generate nav buttons for this kind of (sub-)pages.
In the HTML code the plugin generates an iframe with recognizable contents, like
iframe class="filter_embedquestion-iframe" ..."" title="Embedded question" src="https://.../filter/embedquestion/showquestion.php?...
The readme file says that this version does not need to have core changes.