You can hide menu items like "my files" , "shared files", "site finder" from alfresco share with the help of Aikau.
There is 2 different technique to do so which are
- By using helper function widgetUtils.deleteObjectFromArray .
- Configuration exposed by the alfresco/header/AlfSitesMenu widget.
Let's do it with the help of first one:
First method (By using helper function widgetUtils.deleteObjectFromArray) takes three parameter .
- The object to remove the widget definition from (you can typically just use model.jsonModel).
- The attribute to search for (in our case it is id).
- The id attribute of the widget definition to remove.
So suppose we want to remove "My Files" link from the menu bar you would include the following code in the file share-header.get.js.
"widgetUtils.deleteObjectFromArrary(model.jsonModel, "id", "HEADER_MY_FILES");"
Now save the file and restart the application server by entering run.sh command.
Log in to Share, you will see that the My Files menu item is no longer present on the main menu.
Another example, Suppose we want to hide the "Site Finder", so you would include the following code in share-header.get.js file
// find the "Sites" menu...
var sitesMenu =
"widgetUtils.findObject(model.jsonModel, "id", "HEADER_MY_FILES");
if (sitesMenu !=null)
//Hide the Site finder...
sitesMenu config showSiteFinder =false:
Now save the file and restart the application server by entering run.sh command to update your surf extension module.
aikau share page