none
How to display image from custom list in content query webpart ?

    السؤال

  • Hello,

    I am having one custom list with following items

    1) Title - single line of text

    2) Image  -  Picture or Hyper link

    3) Description - Multiline of text

     

    I need to display item from this list in Content Query Webpart , how can i display data in content query webpart ?can anyone provide me stylesheet for that pelase for following format ?

    Please let me know , i am waiting for your favourable reply.

    Thanks,


    dipti chhatrapati
    22/ذو الحجة/1432 10:11 ص

الإجابات

  • Hi Dipti, 

    First of all you can try using the existing Item style: Image on right 

    Edit Content Query webpart: In Presentation, under Item Style select Image on right

    in the Fields to display set Image field to Image;

    Description to Description;

    click apply. see if this works for you, if not happy with the display Modify it:

     in SP Designer scroll down to Style Library Expand XSL Style Sheets and checkout and edit in advance mode ItemStyle.xsl (you can always revert it to the original one: right click Reset to Site Definition)

    search for ImageRight select the entire xsl template (template starts on line 200 ends on 266) copy scroll all the way to the end of the file and paste this template right before </xsl:stylesheet>

    rename this newly copied  template (name and style)

    <xsl:template name="ImageRight" match="Row[@Style='ImageRight']" mode="itemstyle"> i.e. MyImageList so it becomes:

    <xsl:template name="MyImageList" match="Row[@Style='MyImageList']" mode="itemstyle">

    save the file, go back to the page and change Item Style from Image on right to MyImageList

    save the page now you can go back into ItemStyle.xsl file and fuss with your template. change styles alignment etc. 

    hope this helps 

    Evgenia

     

     

    • تم وضع علامة كإجابة بواسطة Dipti Chhatrapati 25/ذو الحجة/1432 05:00 ص
    22/ذو الحجة/1432 07:02 م

جميع الردود

  • Hi

    is some pic missing in your post?

    Let me know how do you like to have the webpart, and i will try to post a real ex for you.


    Romeo Donca
    22/ذو الحجة/1432 03:43 م
  • Hi Dipti, 

    First of all you can try using the existing Item style: Image on right 

    Edit Content Query webpart: In Presentation, under Item Style select Image on right

    in the Fields to display set Image field to Image;

    Description to Description;

    click apply. see if this works for you, if not happy with the display Modify it:

     in SP Designer scroll down to Style Library Expand XSL Style Sheets and checkout and edit in advance mode ItemStyle.xsl (you can always revert it to the original one: right click Reset to Site Definition)

    search for ImageRight select the entire xsl template (template starts on line 200 ends on 266) copy scroll all the way to the end of the file and paste this template right before </xsl:stylesheet>

    rename this newly copied  template (name and style)

    <xsl:template name="ImageRight" match="Row[@Style='ImageRight']" mode="itemstyle"> i.e. MyImageList so it becomes:

    <xsl:template name="MyImageList" match="Row[@Style='MyImageList']" mode="itemstyle">

    save the file, go back to the page and change Item Style from Image on right to MyImageList

    save the page now you can go back into ItemStyle.xsl file and fuss with your template. change styles alignment etc. 

    hope this helps 

    Evgenia

     

     

    • تم وضع علامة كإجابة بواسطة Dipti Chhatrapati 25/ذو الحجة/1432 05:00 ص
    22/ذو الحجة/1432 07:02 م