Overriding drawer structure

Overriding drawer structure

par Arkadiusz Malkowski,
Nombre de réponses : 7
Avatar 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




Moyenne des évaluations: -
En réponse à Arkadiusz Malkowski

Re: Overriding drawer structure

par Alexander Bias,
Avatar Core developers Avatar Peer reviewers Avatar 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

En réponse à Alexander Bias

Odp: Re: Overriding drawer structure

par Arkadiusz Malkowski,
Avatar Testers
All in all, I meant a solution which doesn't require plugins.
En réponse à Arkadiusz Malkowski

Re: Odp: Re: Overriding drawer structure

par Acqua Alta,
I agree with you. But I would also like to say that the plugin developed by Alexander is a great plugin smile
En réponse à Arkadiusz Malkowski

Re: Overriding drawer structure

par Jean-Roch Meurisse,
Avatar Core developers Avatar Plugin developers Avatar 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!
En réponse à Jean-Roch Meurisse

Odp: Re: Overriding drawer structure

par Arkadiusz Malkowski,
Avatar 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.
En réponse à Arkadiusz Malkowski

Re: Odp: Re: Overriding drawer structure

par Jean-Roch Meurisse,
Avatar Core developers Avatar Plugin developers Avatar 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
Moyenne des évaluations:Useful (1)
En réponse à Arkadiusz Malkowski

Re: Overriding drawer structure

par Mary Evans,
Avatar Core developers Avatar Documentation writers Avatar Peer reviewers Avatar Plugin developers Avatar Testers
You could use a renderer I suppose but it may not work as the coding is different than it used to be in earlier versions.
I made some minor changes to the calendar renderer in this page...

https://github.com/lazydaisy/gologo/blob/master/classes/core_calendar_renderer.php

You might find it helpful.

Cheers
Mary
Moyenne des évaluations:Useful (1)