-1
  • Library contains contents . Each content contains tags. One tag may link to many contents.

  • Whenever use clicks particular tag i need to display contents. After clicking contents I am trying to display related documents.

  • In the code,passing content document Id for displaying documents but itsnot working.

Approach followed:

  • Even I have tried passing Content version Id also its still not working
  • Tried with Community url also
  • Getting broken image in my case (trying for Community)

     <aura:component  implements="forceCommunity:availableForAllPageTypes" 
     access="global">
        <aura:attribute name="id" type="Id"/> 
          <aura:attribute name="ContentIds" type="Id" 
    default="0690n000000QcF6"/> 
    
       <aura:attribute name="prefixURL" type="String" 
     default="/sfc/servlet.shepherd/version/download/"/>
     <img src="{!v.prefixURL+v.ContentIds}" width="100" height="100"/>
    </aura:component>
    

I referred below stack exchange code, tried in my org its working for both community & app builder

Display an image stored in ContentDocument (in lightning experience)

Problem in the code: If attachment is pdf,itsnot working!!

1 Answer 1

0

I got a solution finally.

Using lightning Tile card it works

 <lightning:fileCard fileId="{!v.ContentdocIds}"/>

Here ContentdocIds - ContentDocumentId

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .