<asp:ContentPlaceHolder
id="PlaceHolderLeftActions"
runat ="server"/>
some times picture library thumbnail view wont work properly (for ex when you add it to site pages or any other pages). here is the small fix for this.
1) add content editor webpart to your page and select Content editor webpart the one you added and go to EditHtmlsource > copy and paste below code.
2)that's it.. now you are good to go....
<TABLE style="padding-top: 8px" cellSpacing=0 cellPadding=0 border=0 width=100%>
<TR valign=top><TD> </TD></TR>
</TABLE>
<TABLE id=ImgPreviewTable cellSpacing=2 cellPadding=0 border=0 width=100% style="display:none">
<TR><TD vAlign=center >
<SharePoint:EncodedLiteral ID="EncodedLiteral1" runat="server" text="<%$Resources:wss,piclib_picturePreview%>" EncodeMethod='HtmlEncode'/></TD></TR>
<TR><TD class="ms-navline" width=128><IMG SRC="/_layouts/images/blank.gif" width=1 height=1 alt=""></TD></TR>
<TR>
<TD vAlign=center align=center style="padding-top:3px" onClick="ClickPreview(); return false;">
<a name="lnkPreviewImg" id="lnkPreviewImg" href="Javascript:">
<img SRC="/_layouts/images/preview.jpg" NAME=ImgPreviewThumbnail ID=ImgPreviewThumbnail class=thumbnail height=90 width=120 alt="<SharePoint:EncodedLiteral runat='server' text='<%$Resources:wss,piclib_picturePreview%>' EncodeMethod='HtmlEncode' __designer:Preview="Picture Preview"/>"></a><br>
<a name="lnkPreviewTitle" id="lnkPreviewTitle" href="Javascript:" class="ms-imglibPreviewTitle">"<SharePoint:EncodedLiteral ID="EncodedLiteral2" runat='server' text='<%$Resources:wss,piclib_pictureFileName%>' EncodeMethod='HtmlEncode'/>"</a>
</TD>
</TR>
</TABLE>
Adding above code to content editor webpart.
Surya, This code is really good and it solved my issue in Sharepoing picture gallery.
ReplyDeleteGood work.. keep it up.
This code didnot work in my case. I added a Content editor webpart --> Modify Shared Webpart --> Source editor and pasted your code in there.But unfortunately it is not displaying any image as there are two pics in my picture library. Also one question arises is if theree are two or more than two picture libraries then how does it identify which one to pick out of the two ?
ReplyDeleteCheers,
Amiya
Amiya, I just tried above code and it is working fine when you have single pic lib in a page. If you have 2 libraries i would suggest you to go for pic lib and asset lib as shown in my blog (just updated.)
DeleteThanks,
Surya.