Change URL link on "website" and "help" sidemenu options

Change URL link on "website" and "help" sidemenu options

by Pedro Carrión -
Number of replies: 6

Hi,

I am making a customized version of moodle mobile app. I followed the guide and everything went fine. Now I want to change the links on "Website" and "Help" sidemenu options, these by default links to my site home and "https://docs.moodle.org/31/en/Moodle_Mobile". How can I change this behaviour ? I know php and javascript but I am not familiar with angular framework.

Pedro

Average of ratings: -
In reply to Pedro Carrión

Re: Change URL link on "website" and "help" sidemenu options

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Hi Pedro,

those URLs are configured in the file:

core/components/sidemenu/templates/menu.html

To change the Website URL, you need to modify the item that uses the string mm.sidemenu.website. You can remove the ng-href attribute and use the href you want, or make the ng-href point to some other variable.

Yo change the docs url you need to modify the item that uses the string mm.sidemenu.help. As before, you can use a fixed href or you can change the value of the docsurl variable.

Kind regards,

Dani

In reply to Dani Palou

Re: Change URL link on "website" and "help" sidemenu options

by Shao Chen -

I can change the website on side menu in the menu.html, but couldn't find the place that turn off "my file" on the side menu. Please help.

Thanks


In reply to Shao Chen

Re: Change URL link on "website" and "help" sidemenu options

by Manjunath Moodle -

Dear Shao,

  One option is custom CSS like this -  https://moodle.org/mod/forum/discuss.php?d=341039 

  Other option is to remove respective "addon" or make changes in services/handlers.js of respective addon depending on your requirement.

  Hope this helps.

  

 

  

In reply to Manjunath Moodle

Re: Change URL link on "website" and "help" sidemenu options

by Shao Chen -

Thank you so much. I have further questions:

1. The custom CSS is great. I can see to hide the "website" and "help" from the side menu. But how do you hide the "files" from the side menu?

2. I remove the "files" from the "addon", but the "my files " is still on the side menu, although it doesn't link to files anymore. Where can I remove the "my files" from the side menu? I read before that I need to change a file after removing items from "addon", but I couldn't remember which file.

3. I can't find the services/handlers.js file. 

Many Thanks.

In reply to Shao Chen

Re: Change URL link on "website" and "help" sidemenu options

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Hi Shao,

the first thing you need to take into account is that we use "gulp" to build the Javascript file.

If you have your environment ready to use gulp (as it is explained in here) you can edit the files inside www/addons and www/core to achieve what you want. You should open www/addons/files/main.js and delete the line:

$mmSideMenuDelegateProvider.registerNavHandler('mmaFiles', '$mmaFilesHandlers.sideMenuNav', mmaFilesPriority);

You need to run gulp after applying these changes. This will remove the My Files option.


If you don't, then you'll have to edit www/build/mm.bundle.js. You need to delete the same line as above. In this case you don't need to run gulp since you're already editing the final file.

Please let me know if you have any other problem.

Cheers,

Dani

In reply to Dani Palou

Re: Change URL link on "website" and "help" sidemenu options

by Shao Chen -
I am using gulp. It works. Thank you so much.