How to hide menu items from alfresco share, such as My Files, Shared Files, etc

cancel
Showing results for 
Search instead for 
Did you mean: 
dpmar
Member II

How to hide menu items from alfresco share, such as My Files, Shared Files, etc

Hi, i am the first step in Alfresco and i would like to known how i can hide links My Files, Sharing files, Sites, My Tasks from UI of alfresco share. Thanks

6 Replies
angelborroy
Alfresco Employee

Re: How to hide menu items from alfresco share, such as My Files, Shared Files, etc

dpmar
Member II

Re: How to hide menu items from alfresco share, such as My Files, Shared Files, etc

Thanks for answering my question, I had come across this article but I did not consider it because I found it complicated, you know the first weapons, create an AIO project, add a share extension called customize-share-header Menu, create a new Share AMP module as part of your AIO project, ect., I lost, I thought there was a simpler way to solve the problem but at this point I think the only way to go is to You advised me. Thank you so much, I will read the article that you have reported me more carefully. Hello Marco

krutik_jayswal
Senior Member II

Re: How to hide menu items from alfresco share, such as My Files, Shared Files, etc

Below is code for removing shared file menu from MenuBar.

widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_SHARED_FILES");

You need to extend Share Header. and add above code in the file.

amitkulhari26
Active Member II

Re: How to hide menu items from alfresco share, such as My Files, Shared Files, etc

Hello,

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

  1. By using helper function widgetUtils.deleteObjectFromArray .
  2. 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.

Thanks !

aikau‌ share page‌

@macro dp

jpotts
Professional

Re: How to hide menu items from alfresco share, such as My Files, Shared Files, etc

Never ever, ever, ever change files in the alfresco.war, share.war, or the exploded alfresco webapp or share webapp.

frcm
Member II

Re: How to hide menu items from alfresco share, such as My Files, Shared Files, etc

I jeff,I'm right with you, it's not a good pratice but ... it works ...

I tried to follow the Alfresco tuto (6.1) but ever something wrong ...

Exemple, I deploied the environment with docker and apply the first tuto (sub-menu on admin menu), and it's ok with all-in-one but I don't understand how deplied it in prod envinoment (that's not a docker environment).

I try to put the all-in-one-share...jar in the shared tomcat folder but nothing appened when a restart tomcat, no error in catalina.out !!

Someone can help me ? another tuto perhaps with less theory :-)