cancel
Showing results for 
Search instead for 
Did you mean: 

Document preview on and off on user request

swati
Champ in-the-making
Champ in-the-making
Hi,

I want to allow user to turn off page preview which is on by default.

I can see web-preview.js contains preview related code but want to know how can I set preview on and off.

Please suggest.



Thanks,

Swati
2 REPLIES 2

douglascrp
World-Class Innovator
World-Class Innovator
You have to include this section on your share-custom-config file


   <config evaluator="string-compare" condition="DocumentDetails">
      <document-details>
         <!– display web previewer on document details page –>
         <display-web-preview>true</display-web-preview>
      </document-details>
   </config>


The OOTB file defining that is share/WEB-INF/classes/alfresco/share-documentlibrary-config.xml

swati
Champ in-the-making
Champ in-the-making
Thanks for reply.

By making these changes, it will show/hide preview from user.
But our requirement is to turn this preview on/off on user request.
If User wants to show the preview, it will preview documents by default but he sets preview to be turned off
it should be off for all docs in documentlibrary.
This should be done on onclick event of a link.

How to go about this?