2

I have created a view in Picture Library's schema file. I want to display the thumbnail of the image with fields.

My code for view is:

<View BaseViewID="13" Type="HTML" WebPartZoneID="Main" DisplayName="Custom Thumbnail" TabularView="TRUE" DefaultView="TRUE" SetupPath="pages\viewpage.aspx" Url="Forms/Thumbnails1.aspx" ImageUrl="/_layouts/15/images/plicon.png?rev=23">
    <JSLink>SP.UI.TileView.js|callout.js</JSLink>
    <XslLink Default="TRUE">main.xsl</XslLink>
    <JSLink>clienttemplates.js</JSLink>
    <RowLimit Paged="TRUE">30</RowLimit>
    <ViewFields>
      <FieldRef Name="Thumbnail"/>
      <FieldRef Name="ImageWidth" />
      <FieldRef Name="ImageHeight" />
      <FieldRef Name="FSObjType" />
      <FieldRef Name="EncodedAbsUrl" />
      <FieldRef Name="Description" />
      <FieldRef ID="{96B83E27-8364-41F6-846B-DF6DBDB6D22E}" Name="oiplbCategory"/>
      <FieldRef ID="{7B0A2603-E100-4856-A58A-251EDF22CBBC}" Name="oiplbBrand"/>
      <FieldRef ID="{8D4BAE9C-6A0F-4805-A910-8B5973F64769}" Name="oiplbBusinessArea"/>
      <FieldRef ID="{A8E2B4E7-0422-428F-99C8-B1FF3ABE5B1F}" Name="oiplbResolution"/>
      <FieldRef ID="{FF551562-7DB4-46CE-857D-BBC6E7574EF9}" Name="oiplbSearchAlias"/>
    </ViewFields>
    <Query>
      <OrderBy>
        <FieldRef Name="FileLeafRef">
        </FieldRef>
      </OrderBy>
    </Query>
    <ParameterBindings>
      <ParameterBinding Name="NoAnnouncements" Location="Resource(wss,nopicturesinview_clickupload)" />
      <ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,nopicturesinview_clickupload_howto)" />
        </ParameterBindings>
</View>

The column is displayed but after uploading the image it displays blank image instead of small image version of uploaded image. What should I do?

  • Where have you found this field "Thumbnail"? In my picture libraries the closest column I can find is "ThumbnailOnForm" – Robert Lindgren Dec 11 '13 at 11:20
  • In the <Views></Views> there is first view definition with base view id=0 . In that view there <FieldRef Name='Thumbnail'/> is given. – users1100 Dec 11 '13 at 11:34
  • Ah okey, is there a reasoen why you have two "<JSLink>" nodes? – Robert Lindgren Dec 11 '13 at 11:36
  • No sir, actually I don't know about the JSLink 2 times but there is also 2 jslink nodes in built in Thumbnails view in schema – users1100 Dec 11 '13 at 11:40
1

You probably didn't add these properties to <List> in Schema.xml:

ThumbnailSize="160" 
WebImageWidth="640" 
WebImageHeight="480"

And these fields to View:

<FieldRef Name="DocIcon" />
<FieldRef Name="PreviewOnForm" Explicit="TRUE" />

Without them the thumbnails aren't shown.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.