Wednesday, April 23, 2014

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.

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.
SharePoint 2013 how to add content search web part
Now, the web part should look like the below image. Click on "Edit Web Part" from the web part menu, content search web part sharepoint 2013
Click on "Change Query" button from the web part properties pane.
sharepoint 2013 slider
 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.
sharepoint 2013 slider web part

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.
sharepoint 2013 content search web part display templates
That's all! Done, This is what we get in the page!
sharepoint 2013 carousel

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"
 content search web part sharepoint 2013 tutorial
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. sharepoint 2013 content slider
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.
sharepoint 2013 content search webpart slideshow
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).
sharepoint 2013 content search web part picture url
That's all! Now the banner images will be pointing to the URLs specified in TargetURL column!

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.

Check out these SharePoint products:


  1. Just created this week before and took one step further. Customized display control templates and item template. Looks fab. so happy with it :)

  2. what is the frequqncy fo crawl in sharepoint online E3, will it display immidetly!


    1. As per Microsoft KB:, Its targeted between 15 Minutes to 1 Hour! In Heavy usage environments, It can take up to 6 Hours!

  3. This is great!

    although it shows a shaded area at the bottom of the do you get rid of that?

  4. Great guide and it works perfectly!
    Like 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?

    1. Hi Alex,
      Did you get this to work?

  5. ¿How can I make the number of pictures to display dynamic? I want to display all the available pictures...

    By the way a very big THANK YOU!!

  6. Great Post.. Thank you!!!

  7. I 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,
    Thank you in advance and any help would be greatly appreciate.

  8. Hi , Nice Article, simple and great functionality from out of box feature.

    I 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

  9. Works like a charm, thanks for the blog...

  10. Sometimes 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.

  11. Hi
    in 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.

  12. i need couple of changes.
    first when click on image it should open url in new window
    2nd thing navigation not moving back and forth its opening the picture library,

  13. navigation not working its opening picture library

  14. Hai first of all thank you for this nice post,here How can we increase the picture size??

    1. I would also like to know the answer to this, because currently the images are to small especially the width.

    2. I 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

  15. This comment has been removed by the author.

  16. I 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.

    I 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.


Please Login and comment to get your questions answered!

You might also like:

Related Posts Plugin for WordPress, Blogger...