Moodle for mobile

Adding new main menu item to Moodle Mobile 3.5.2

 
Picture of Mohammad Hallak
Adding new main menu item to Moodle Mobile 3.5.2
 

Greetings, 

I am trying to develop a new plugin to add an item to the main menu more items. My problem is that the plugin name is showing as: "plugin.local_parentagenda.Agenda" in the main menu more items, however, I want to display it as "Agenda" as highlighted in the below image.

Please advice!

  • Moodle site version: 3.3.1
  • Moodle Mobile version: 3.5.2


 
Average of ratings: -
Picture of Dani Palou
Re: Adding new main menu item to Moodle Mobile 3.5.2
Core developersMoodle HQParticularly helpful MoodlersPlugin developers

Hi,

you should return the string in the "lang" property. If you look at the example in this step, you'll see it has a "lang" property. This allows you to localise the strings, and it is required for the title of the plugin (what is displayed in the menu). So if your string is named "agenda", you should add this in the list of langs:

    array('agenda', 'parentagenda'),

And the title should be 'agenda'.

Cheers,

Dani


 
Average of ratings: -
Picture of Mohammad Hallak
Re: Adding new main menu item to Moodle Mobile 3.5.2
 

Hi Dani thanks for replying,

The problem was solved, but it took some time to realize what was causing this problem.

Following what you said about changing the string in the "lang" property in the mobile.php file to:

array('agenda', 'parentagenda'), 

The title was being displayed as "agenda", so after doing some trial and error it turns out that I had to replace 'parentagenda' with 'local_parentagenda' since the plugin was a "local plugin" and the one provided in the documentation is under "mod" (mod_certificate).

So that's about it, now it's being displayed as "Agenda" in the menu and it's working perfectly.

Thanks for the help Dani


 
Average of ratings: -