Overriding drawer structure

Overriding drawer structure

by Arkadiusz Malkowski -
Number of replies: 7
Picture of Testers

Hi,

I wonder if using renderers.php in Boost i can overwrite  drawer structure.

E.g  remove calendar display.


I know code responsible for displaying these items is in navigationlib.php

// Calendar
$calendarurl = new moodle_url('/calendar/view.php', $params);
$node = $coursenode->add(get_string('calendar', 'calendar'), $calendarurl,
self::TYPE_CUSTOM, null, 'calendar', new pix_icon('i/calendar', ''));
$node->showinflatnavigation = true;

But I don't want to modify it, I'd rather get it in the template




Average of ratings: -
In reply to Arkadiusz Malkowski

Re: Overriding drawer structure

by Alexander Bias -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

You might want to have a look at our plugin https://moodle.org/plugins/local_boostnavigation to see if it already serves your needs.

Cheers,
Alex

In reply to Alexander Bias

Odp: Re: Overriding drawer structure

by Arkadiusz Malkowski -
Picture of Testers
All in all, I meant a solution which doesn't require plugins.
In reply to Arkadiusz Malkowski

Re: Odp: Re: Overriding drawer structure

by Acqua Alta -
I agree with you. But I would also like to say that the plugin developed by Alexander is a great plugin smile
In reply to Arkadiusz Malkowski

Re: Overriding drawer structure

by Jean-Roch Meurisse -
Picture of Core developers Picture of Plugin developers Picture of Testers
Hi,
You can hide calendar item in navdrawer by adding something like
#nav-drawer a.list-group-item[data-key="calendar"] {
    display: none;
}

In boost "raw scss" setting

Hope this helps!
In reply to Jean-Roch Meurisse

Odp: Re: Overriding drawer structure

by Arkadiusz Malkowski -
Picture of Testers
Yes I know it.
However, we can easily restore the button

I would like to get this through a renderer. Also as part of learning.
In reply to Arkadiusz Malkowski

Re: Odp: Re: Overriding drawer structure

by Jean-Roch Meurisse -
Picture of Core developers Picture of Plugin developers Picture of Testers
As far as I know, to modify navigation (f.e remove a node from navdrawer), you have to implement method *yourplugin*_extend_navigation, but this callback is not available in themes, so you must implement it in a local plugin for example
Average of ratings: Useful (1)