Hide download button in document previewer for specific custom content type

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
yash_patel_c2
Established Member

Hide download button in document previewer for specific custom content type

Hello everyone,

I want to hide download button in document previewer for 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 type, i.e. for one particular content type download button in the document previewer will be hidden while documents of other content types can see Download button in the document previewer.

Thanks

2 Replies
roberto_gamiz
Established Member II

Re: Hide download button in document previewer for specific custom content type

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

sanjaybandhniya
Senior Member

Re: Hide download button in document previewer for specific custom content type

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