I added a link column in my picture library and populated with links. Then added SP OOTB picture library slide show web part. Both pictures and it's description are showing. I need the link to be on the image so when user click on image it goes to whatever I put in the link field.
But it could be customized on the client side, the solution presented below demonstrates how to customize SlideShow control.
Load custom Picture Library fields
The following fields are loaded via SPQuery from Picture Library in Picture Library SlideShow web part:
Title- picture title
Description- picture description
EncodedAbsWebImgUrl– Url of web image is used for displaying picture
EncodedAbsUrl– Url of original image is used for picture link
ImageWidth– picture width
ImageHeight– picture height
So, in order to specify custom field for picture link we need to load it also. Loading of additional fields could happen during Slideshow initialization on the client side.
Specify custom field value for picture link
After custom fields are loaded, we need only to modify custom picture link values.
The code below demonstrates how to override
ShowPic function that is used for initializing picture in SlideShow:
For implementation details please follow this blog post.
There is OOTB Functionality in 2013 to complete this task and it can all be done with Site Collection Admin Permission Level (it can be done better with Farm Admin, but that gets more complicated, so I won't cover that)
- Add Picture Library and populate with Pictures
- Go to Site Settings > Site Columns (under Web Designer Galleries)> Create new Site Column
Column Name: Slide URL-Text (You can name this whatever you want, but remember what you name it)
Column Type: Single Line of text
- Go back to Picture Library you created in Step 1. Go to Library Settings > Add from existing site columns > Slide URL-Text
- Now Edit each picture in your library and add the URL you wish to link to in the Slide URL-Text box, and wait for the a full search crawl to occur or run it manually if you have Farm Admin - by default this happens every hour
- Edit the page where you want the Slide show, add the web part if you haven't already and then click Edit Web Part
- Change the Property Mappings by selecting the checkbox 'Change the property mapping of managed properties for the fields in the Item Display Template'
- In The Link URL Field, find your Slide URL-Text field and enter it here - change nothing else. Click Ok, and Save / Publish your page. See image below
You'll notice SharePoint removes spaces and adds letters usually OWSTEXT either in front of or behind your column - this is where having Farm Admin comes in handy so you can customize the managed property to display how you desire, as well as being able to use a hyperlink field for this same purpose
You're Done. Everything should work!
Make sure you wait for a full crawl to occur(you may need to wait overnight, depending on how your search timer jobs are set. Ask your SharePoint admin how often a full crawl happens if you aren't sure.
Important Note: Don't try to use a Hyperlink field for this without knowing what you're doing with Crawled / Managed properties as you will need to map the hyperlinked crawled property to a Managed Property of Text type, else the Slideshow WebPart Display Template will display a nasty error on you.