I'm only now starting to make use of the images & documents module, but it's been pretty handy so far! however one problem I've encountered is that there doesn't seem to be any way to resize the Single Item View image so that it doesn't break the layout. I've uploaded rather large sized images, since I want users to be able to download the full resolution, however when showing it on the screen I want it to fit inside the template...
I found the property to change the Thumbnail image size, but none exists that I could find to change the Single Item size... I managed to create a workaround, but if I did this for nothing, and this functionality is built into the system, please let me know!
Basically I just added a new UserControl into the /sitefinity/contenttemplates/libraries folder and copied and pasted everything from the GalleryListViewItemTemplate.ascx file into it. I modified it by wrapping a hyperlink around the image:
|<p class="sf_singleImage"> |
| <asp:HyperLink ID="lnk" runat="server"> |
| <asp:Image ID="Img" runat="server" /> |
| </asp:HyperLink> |
then in the code behind for this control I added the following:
|protected void Page_Load(object sender, EventArgs e) |
| lnk.NavigateUrl = Img.ImageUrl; |
| lnk.Target = "_blank"; |
| Img.ImageUrl += "?width=520&height=350&decreaseOnly=true&proportional=true"; |
Finally, you need to Edit the ImageGallery control on your page and in the Advanced Tab change the value of ListViewItemTemplatePath
where TEMPLATE is the name of the copied user control you created.
now on the single item page, the image is sized inside the template, with a link to the full res item for downloading!
By the way, I noticed that I had to set both width and height, otherwise the resize wouldn't work. I was hoping to be able to just set width, and have it automatically resize the height based on proprotion, but coudn't figure out how to do that.... what is the correct way to do this, or is it even possible?
anyway, I hope this is helpful to someone, please let me know if there is a better way to do this! thank you!