cancel
Showing results for 
Search instead for 
Did you mean: 

Hide download button in document previewer for specific custom content type

yash_patel_c2
Star Contributor
Star Contributor

Hello everyone,

I want to hide the download button in the document previewer for the specific custom content type. Right now I have hidden download button for every document in alfresco by updating AlfrescoUtil.param("showDownload", "false"); and showDownload : (model.showDownload == "false") and in node-header.get.js. How can I achieve this for specific custom content types, i.e. for one particular content type download button in the document previewer will be hidden while documents of other content types can see the Download button in the document previewer?

Thanks

Yash

2 REPLIES 2

roberto_gamiz
Star Contributor
Star Contributor

Hello,

In your case I would implement a custom repository service, with noderef as param, that will return the value of showing the download button comparing node's type with a list of predefined types.


Then I would call this service from node-header.get.js and set showDownload option of NodeHeader component.

You have two options to achieve that using share extension mechanism:

Overwriting it or extending it and changing the value of the property in the component.

Regards

sanjaybandhaniya
Elite Collaborator
Elite Collaborator

Hi Yash,

In node-header.get.js,there is one object which is getting all the details of node.

var nodeDetails = AlfrescoUtil.getNodeDetails(model.nodeRef, model.site, null, model.libraryRoot);

This object is providing properties,mimetype,parent details and all.....

You can use it to get content type of document ex. nodeDetails.item.node.type;

Thanks,

Sanjay