cancel
Showing results for 
Search instead for 
Did you mean: 

How to hide the 'Like' option in the document list

hagak
Champ in-the-making
Champ in-the-making
I have figured out how to hide the "Like" and QuickShare on the Node-header using the following


<component>
    <scope>template</scope>
    <region-id>node-header</region-id>
    <source-id>document-details</source-id>
    <sub-components>
       <sub-component id="default">
       <evaluations>
           <evaluation id="hideItems">
           <url>/components/node-details/node-header</url>
           <properties>
                <showLikes>false</showLikes>
                <showQuickShare>false</showQuickShare>
           </properties>
           </evaluation>
       </evaluations>
    </sub-component>
  </sub-components>
</component>


However I am unable to figure out how to do this on the documentlist page and on the dashlets that use the same widget.
2 REPLIES 2

scouil
Star Contributor
Star Contributor
Hi,

I don't believe there is any way to do so without extending documentlist.js.
Maybe some CSS could do the deal if you really need something simple but it will feel unstable.

Otherwise, here are 2 possible alternatives:
1) Hide "quickshare" but keep "like"
This can be done with the following config:

<config evaluator="string-compare" condition="Social" replace="true">
   <quickshare />
</config>

Basically the code checks that the QUICKSHARE_URL is there before displaying the component. Removing it cancels the component rendering.

2) Hide the whole social block (favorite, like, comment, quickshare)
This can be done by overriding the default metadata template config:

<config evaluator="string-compare" condition="DocumentLibrary" replace="true">
    <metadata-templates>
         <template id="default">
            <banner index="10" id="lockBanner" evaluator="evaluator.doclib.metadata.hasLockBanner">{lockBanner}</banner>
            <banner index="20" id="syncTransientError" evaluator="evaluator.doclib.metadata.hasSyncTransientErrorBanner">{syncTransientError}</banner>
            <banner index="30" id="syncFailed" evaluator="evaluator.doclib.metadata.hasSyncFailedBanner">{syncFailed}</banner>
            <line index="10" id="date">{date}{size}</line>
            <line index="20" id="description" view="detailed">{description}</line>
            <line index="30" id="tags" view="detailed">{tags}</line>
            <line index="40" id="categories" view="detailed" evaluator="evaluator.doclib.metadata.hasCategories">{categories}</line>
            <!–<line index="50" id="social" view="detailed">{social}</line>–>
         </template>
   </metadata-templates>
</config>


Disclaimer:
I came up with those 2 based only on the code for that specific area. I haven't tested them.
So if you decide to go with any of those 2 alternatives, check your Alfresco for side effects.

hagak
Champ in-the-making
Champ in-the-making
I attempted to solve this using a solution found on stack overflow:
http://stackoverflow.com/questions/11115822/how-to-customize-the-document-list-in-alfresco/23981067#...

However I found that it was bugging at best(like would reappear based on how you navigated) and did not seem to work with the dashlets that utilize the documentlist.