[Adaptable] Change navbar fa icons and text of: Home and Tools.

[Adaptable] Change navbar fa icons and text of: Home and Tools.

par Ruan Viljoen,
Nombre de réponses : 4
Greetings Moodle Community

Beware:  Wall of text imminent.

Moodle: 3.3 (Build: 20170515)
Adaptable:  1.4 (Build: 2017053000)


To put the following in context, I decided against using the Adaptable theme's homepage as the landing page for our sister organisation.  I've setup a homepage using Wordpress and a specific theme that's the same as our parent organisation to keep the look and feel consistent before navigating to Moodle itself.

That being said, I still want to make use of Moodle's homepage as I feel that it's still the best way to easily display all the available courses that potential learners might be interested in, and would be easier for existing learners to go and browse what other courses they might also want to enroll in.

Basically changing the use of the homepage to a course catalog.

So I want to change this...

to this...

I just need confirmation whether the following changes I made to the renderers.php on the development site are good and won't break something else before implementing it on the production site.

Home button changes; fa icon and text:
renderers.php, line 1628
                $branchtitle = get_string('courses');
                $branchlabel = '<i class="fa fa-th"></i> '.$branchtitle;

Tool button change; fa icon:
renderers.php, line 1845
                $class = "<i class='fa fa-list'></i><span class='menutitle'>"; 

It's worth noting that the tools menu would be used for all the navigation links that are in the navigation block, though it wouldn't be dynamic as the navigation block but it would help.  Is it possible to implement a hierarchy-list (not sure what to call it.  Being able to have 1 item expand into more items, i.e:  Course Options >>  Create Course, View Participants, etc) in the tools menu by editing the code?

I'd like to see these features in a future release of Adaptable, obviously they wouldn't be of priority unless more people would like to see it.

Thank you for taking the time to read this!
Ruan

Moyenne des évaluations  -
En réponse à Ruan Viljoen

Re: [Adaptable] Change navbar fa icons and text of: Home and Tools.

par Ruan Viljoen,

I forgot to add an additional change I made to make the change to the Home button possible:

renderers.php, line 1546
                                   html_writer::tag('i', '', array('class' => 'fa fa-th fa-lg')));
renderers.php, line 1549
                                   
$breadcrumbs .= html_writer::link(new moodle_url('/'), get_string('courses'));


Exactly for this reason do I need confirmation.  Php returns errors if making changes to all references at their respective locations.  However it's possible to make the appropriate changes, not having any errors, but still missing a crucial change that had to be made elsewhere which could result in an error due to a specific action that wasn't immediately apparent.

En réponse à Ruan Viljoen

Re: [Adaptable] Change navbar fa icons and text of: Home and Tools.

par Fernando Acedo,
Avatar Plugin developers Avatar Testers

As I said, modify the code is not a good idea but change an icon shouldn't be a problem except for upgrades. If you get errors then probably you add some mistake in the code. The impact of a small change in the rest of the code depends of what are you changing. If you rewrite the full navbar menu probably you will break some other part like the mobile menu.

But the breadcrumb shouldn't have impact in other parts.

En réponse à Ruan Viljoen

Re: [Adaptable] Change navbar fa icons and text of: Home and Tools.

par Fernando Acedo,
Avatar Plugin developers Avatar Testers

Changes in the moodle core or in a extension never are good. If you upgrade Adaptable those changes will be overwritten. The changes by themselves are right.

Your request has not so much sense and there are several reasons to do not apply this features:

- The Navbar has a limited space. Adding more items will overload the navbar

- Create a course is only valid for some roles that already have the option. It is not a common option, at least from most of the users.

- Participants is already an item menu (because is a common option)

Anyway, you can request this features in the Adaptable's site: https://adaptable.ws/overview/requests

En réponse à Fernando Acedo

Re: [Adaptable] Change navbar fa icons and text of: Home and Tools.

par Ruan Viljoen,

Thank you Fernando

I do understand that upgrading the theme would void the changes I've made, but I'm prepared to reapply those changes after an upgrade.

The "new course >> participants, etc" was just a silly example sourire

Anywho, thank you for confirming that the changes are technically correct!