cancel
Showing results for 
Search instead for 
Did you mean: 

How to hide Upload file button in document library

hiten_rastogi1
Star Contributor
Star Contributor
Hello.

I have a requirement where I want to hide the Upload file button and show it only if we are under a certain folder.

For getting started I created a extension module that hide the button in all cases(I will be creating a custom evaluator later) by commenting out the file-upload button div in toolbar.get.html.ftl but it doesn't seems to work. Any ideas how can I get the module working.

Thanks
1 REPLY 1

art99trash
Star Contributor
Star Contributor
This may not be the correct way, but you could copy
/opt/alfresco/tomcat/webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components/documentlibrary/include/documentlist_v2.lib.ftl

into your alfresco share project as

src/main/amp/config/alfresco/web-extension/site-webscripts/org/alfresco/components/documentlibrary/include/documentlist_v2.lib.ftl

Then remove or comment the UPLOAD BUTTON section


                  <#– UPLOAD BUTTON –>
                  <#–
                  <@markup id="uploadButton">
                     <#if uploadable>
                        <div class="hideable toolbar-hidden DocListTree">
                           <div class="file-upload">
                              <span id="${id}-fileUpload-button" class="yui-button yui-push-button">
                                 <span class="first-child">
                                    <button name="fileUpload">${msg("button.upload")}</button>
                                 </span>
                              </span>
                           </div>
                        </div>
                     </#if>
                  </@>
                  –>


This would remove the Upload button entirely.
I don't know if it's possible to incorporate some kind of evaluator.