SharePoint 2013 Image Carousel (Rotating Banner) using Content Search Web Part
SharePoint 2013 brought an excellent web part to get content from search index, called "Content search web part". Using content search web part, We can build a simple image rotator or content slider in few steps.
Step 1 - Create a Picture Library and upload images:
Go to your SharePoint site, Create new picture library.
Give it a Name, Say "Slides"
Upload required banner images to the library
Step 2: Trigger Incremental Crawl:
Trigger an incremental crawl or wait for the incremental crawl schedule to complete, So that the picture library we created added to search index.
Step 3: Add Content Search Web Part to the page
Navigate to the page where you would like to add content slider, Click on Site settings gear >> Edit page >> On Insert tab, Click on Web part >> Under the content Rollup, select "Content Search" and then click on "Add" button.
Now, the web part should look like the below image. Click on "Edit Web Part" from the web part menu,
Click on "Change Query" button from the web part properties pane.
Select a query as: Pictures (system) and Restrict by app as : Specify a URL. In URL field, enter the URL of your picture library and Click on OK.
Now, in Edit Properties, Set the Number of items to show as per your requirement, and expand Display templates section. Set the Control template as :Slideshow and Item template as Large picture.
That's all! Done, This is what we get in the page!
Step 1: Add new Site column and Include it to the library
We need a column to hold target URL (when banner is clicked!), So lets create a new site column and add it to the Slides picture library. The reason we create site column, rather adding coloumn to the list directly is: We need a Managed property! Fortunately, in SharePoint 2013, all site columns will be automatically created as managed properties!
Navigate to "site action >> Site settings >> Site columns >> Create new site column "TargetURL"

Add site column to the Library:
Go to list settings >> Add from existing site column >> and choose the site column "TargetURL".
Once done, update TargetURL value for all banner images. 
Once done, Initiate either incremental/full crawl - This will create a new crawled property as well as managed property for the custom site column we've added to the picture library.
Verify the managed property: Go to : Site setttings >> search schema >> Managed properties.
Make sure, you get the Managed property listed.
Now, configure the managed property in the content search web part properties. Go to Edit page, Modify web part, And set the "Link URL" value to the managed property created from our custom column (TargetURL).
That's all! Now the banner images will be pointing to the URLs specified in TargetURL column!
Content Search Web part is available only on SharePoint 2013 enterprise edition!
Step 1 - Create a Picture Library and upload images:
Go to your SharePoint site, Create new picture library.
Give it a Name, Say "Slides"
Upload required banner images to the library
Step 2: Trigger Incremental Crawl:
Trigger an incremental crawl or wait for the incremental crawl schedule to complete, So that the picture library we created added to search index.
Step 3: Add Content Search Web Part to the page
Navigate to the page where you would like to add content slider, Click on Site settings gear >> Edit page >> On Insert tab, Click on Web part >> Under the content Rollup, select "Content Search" and then click on "Add" button.
Now, the web part should look like the below image. Click on "Edit Web Part" from the web part menu,

Click on "Change Query" button from the web part properties pane.
Select a query as: Pictures (system) and Restrict by app as : Specify a URL. In URL field, enter the URL of your picture library and Click on OK.
Now, in Edit Properties, Set the Number of items to show as per your requirement, and expand Display templates section. Set the Control template as :Slideshow and Item template as Large picture.
That's all! Done, This is what we get in the page!
How to link banner Images to URLs?
Well, what we've done above is just a slideshow. On clicking banner images, they take us to the individual image from the banner. However, We may have to link banners to different URLs. Say, on clicking the above "New markets"banner, you may want to send users to :http://your-sites/departments/new-markets/ isn't it? So what this step brings in addition is: When user clicks on the banner, where it should takes them, Lets head on to the next step:
SharePoint 2013 generates managed properties for site columns. If you
add a column directly to a list, it will not generate a managed property
automatically!
Step 1: Add new Site column and Include it to the library
We need a column to hold target URL (when banner is clicked!), So lets create a new site column and add it to the Slides picture library. The reason we create site column, rather adding coloumn to the list directly is: We need a Managed property! Fortunately, in SharePoint 2013, all site columns will be automatically created as managed properties!
Navigate to "site action >> Site settings >> Site columns >> Create new site column "TargetURL"

Add site column to the Library:
Go to list settings >> Add from existing site column >> and choose the site column "TargetURL".


Once done, Initiate either incremental/full crawl - This will create a new crawled property as well as managed property for the custom site column we've added to the picture library.

Verify the managed property: Go to : Site setttings >> search schema >> Managed properties.
Make sure, you get the Managed property listed.
Now, configure the managed property in the content search web part properties. Go to Edit page, Modify web part, And set the "Link URL" value to the managed property created from our custom column (TargetURL).
Just created this week before and took one step further. Customized display control templates and item template. Looks fab. so happy with it :)
ReplyDeletewhat is the frequqncy fo crawl in sharepoint online E3, will it display immidetly!
ReplyDelete-PrashanthSparks
As per Microsoft KB: https://support.microsoft.com/kb/2008449, Its targeted between 15 Minutes to 1 Hour! In Heavy usage environments, It can take up to 6 Hours!
DeleteThis is great!
ReplyDeletealthough it shows a shaded area at the bottom of the picture...how do you get rid of that?
Great guide and it works perfectly!
ReplyDeleteLike L Cook mentioned, is there anyway to remove the gray bar that displays the name/title of the picture?
Also, the webpart is shrinking our pictures down. Manually setting the height and width of the webpart leave the pictures the same, smaller, size and just makes scroll bars with blank space. Any thoughts on this?
Hi Alex,
DeleteDid you get this to work?
¿How can I make the number of pictures to display dynamic? I want to display all the available pictures...
ReplyDeleteBy the way a very big THANK YOU!!
Great Post.. Thank you!!!
ReplyDeleteI waited for 1 week but still I am not seeing Target URL under Link URL in the Webpart configuration though the site was crawled ,I can See targetURLOWSTEXT under Managed Property,
ReplyDeleteThank you in advance and any help would be greatly appreciate.
Hi , Nice Article, simple and great functionality from out of box feature.
ReplyDeleteI am not getting TargetURL(TargetURLOWSTEXT) under the "Link" drop down in webpart though I see the TargetURL(TargetURLOWSTEXT) field in crawling /Manager property,
any idea
Thank you in advance
Works like a charm, thanks for the blog...
ReplyDeleteSometimes the Managed property will not get made so just make it and map the crawled property, also try removing gaps if you have any in the name i.e Target link will be Targetlink... Hope that helps.
ReplyDeleteHi
ReplyDeletein this i need some changes.
when click on image it open the new url in new window.
other thing when you click navigation button below right its going to picture library.
i want this should go to next and previous image.
i need couple of changes.
ReplyDeletefirst when click on image it should open url in new window
2nd thing navigation not moving back and forth its opening the picture library,
navigation not working its opening picture library
ReplyDeleteHai first of all thank you for this nice post,here How can we increase the picture size??
ReplyDeleteI would also like to know the answer to this, because currently the images are to small especially the width.
DeleteI am having the same problem. Its not a banner as the Content Search Webpart is left aligned and I can not get it to center and the image is not scretched across the page even tho the image is 1500px x 300px. Anyone figured it out yet? it would really help me
DeleteI have been working on this solution for about two months based on this blog and created the identical scenario. The managed property is still not populating under the "Link URL" when I edit the Content Search Web Part. All aspects o this appear to be set correctly, including reindexing the picture library, full crawl, incremental crawl, ensuring that managed properties have been mapped.
ReplyDeleteI can't not seem to figure out what is wrong. It is an amazing tool and I would love to use this. Any help would be so very much appreciated.
If you are not getting the TargetURL under the Link URL, try typing "TargetURLOWSTEXT" in the Link URL manually. It works for me this way. Hope this helps.
ReplyDeleteI am not sure why I am not able to see anything after setting up the query. I have re-indexed the library. While changing query i see pictures names and path under query result but noting showing up.
ReplyDeleteDo i need to enable any site feature before getting it configured?
Run Search crawl (Indexing) once! Because, content search gets the data from Search index!
DeleteGreat Article It works perfectly fine for me
ReplyDeleteHi,
ReplyDeleteDone everything as per the steps to start my banner. Search query is also resulting in some images as per the URL I am specifying. Re-indexing has also been done. Still images are not appearing in the webpart.
Can you modify the interval time between slides? I'd like the slide images to change once a week.
ReplyDeleteHi,
ReplyDeleteVery very helpful ! :)
can you tell me how to display more than one image at startup?
Regards,
ZP
Sorry, all of my pictures don't appear, I only get a grey background with a "?"
ReplyDeleteLinks not working, on clicking it takes me to site pages library. Gone through all steps, no hiccups. Any suggestions?
ReplyDeletePlease ignore my previous request for links. Its working now. My bad.
ReplyDeleteHello I got exactly the same issue...How did you solve it?
ReplyDeleteWhen I click on the image I'm also directed to "Site Pages". Everything else works fine but this. Any suggestions would be appreciated.
ReplyDeleteI want to have a simple Workflow to manage customer complaints: it's simple form that must undergo a Workflow
ReplyDeletecan u help me pls ???