cancel
Showing results for 
Search instead for 
Did you mean: 

Remove 'New List' button

nancygaillard
Champ on-the-rise
Champ on-the-rise
Hi,
I am on Windows 7x64bits with Alfresco Community 4.2.e
java version 1.8.0_31

I would like to remove the button "New List" in the toolbar of the datalist template.

I found it here :
- <Alfresco_home>\tomcat\webapps\share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\components\data-lists\list.get.html.ftl
- <Alfresco_home>\tomcat\webapps\share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\components\data-lists\datalists.get.html.ftl

Modifying the first file (and restart Tomcat of course ^^) doens't change anything…
However, the second file seems to be the one I have to set, but I don't understand how it doesn't give me the expected result!

There is my issue :
in the following section :
<blockcode>
<@markup id="html">
   <@uniqueIdDiv>
      <#assign id = args.htmlid>
      <div id="${id}-body" class="datalists">
         <div id="${id}-headerBar" class="header-bar toolbar flat-button theme-bg-2">
            <div class="left">
               <span id="${id}-newListButton" class="yui-button yui-push-button new-list">
                   <span class="first-child">
                       <button type="button">${msg('button.new-list')}</button>
                   </span>
               </span>
            </div>
         </div>
         <h2>${msg("header.lists")}</h2>
         <div id="${id}-lists" class="filter"></div>
         <div class="horiz-rule"> </div>
      </div>
   </@>
</@>
</blockcode>
if I simply have removed for test one of the following parts every times :
the whole tag and its contents :
<div class="left">…</div>
,
<span id="…" class="yui-button yui-push-button new-list">…</span>
,
<span class="first-child">…</span>
,
<buton type="button">…</button>

Every times, the result was remaining identical… all of the left part (including the button, the filters, the list of datalists) disappears.

What is the problem?

******
It is a simple test to finally granulate permissions Smiley Happy

Thank you for reading and answering!
1 REPLY 1

s_palyukh
Star Contributor
Star Contributor
You don't see left panel because your javascript code tries to init button and it can't find button and throw an error. If you open js debugger in the browser you will see the reason of problem.

If you want to remove part of html then you need also to patch javascript code that handles clicking on this button, but it isn't the best way…

Take a look at this post http://blogs.alfresco.com/wp/developer/2011/07/29/sub-component-evaluations/ . It will be better solution