image slider with sharepoint 2013 search results web part

37
Image Slider with SharePoint 2013 Search Results Web Part November 23 rd , 2

Upload: gsoft

Post on 08-May-2015

3.516 views

Category:

Technology


0 download

DESCRIPTION

Don’t have access to the enterprise version of SharePoint 2013? Stuck on Office 365? Unable to use the Content Search Web Part? No Problem! Lets build an image slider webpart with the Search Results Web Part using the out of box functionality. A presentation by Yohan Belval and Edouard Shaar

TRANSCRIPT

Page 1: Image Slider with SharePoint 2013 Search Results Web Part

Image Slider with SharePoint 2013 Search Results Web Part

November 23rd, 2013

Page 2: Image Slider with SharePoint 2013 Search Results Web Part

Thank you to all of our Sponsors!!

Page 3: Image Slider with SharePoint 2013 Search Results Web Part

SPS OTTAWA

Yohan Belval

SharePoint specialist at GSoft (Montreal)http://www.gsoft.com/en/blogWeb site (http://gsoft.com)[email protected]@yohanbelval

| 3

WHO

ARE WE?

SharePoint Dynamite TeamFramework on GitHub

Page 4: Image Slider with SharePoint 2013 Search Results Web Part

SPS OTTAWA

Edouard Shaar

SharePoint specialist at GSoft (Montreal)http://www.gsoft.com/en/blogWeb site (http://gsoft.com)[email protected]

| 4

WHO

ARE WE?

SharePoint Dynamite TeamFramework on GitHub

Page 5: Image Slider with SharePoint 2013 Search Results Web Part

SPS OTTAWA

Don’t have access to the enterprise version of SharePoint 2013? Stuck on Office 365*? Unable to use the Content Search Web Part? No Problem! Let’s build an image slider with the Search Results Web Part using the out of box functionality.

Based on blog posts by Yohan BelvalSharePoint 2013SharePoint 2010

*Note: Content Search Web Part is now available in Office 365 E3 and E4 enterprise plans.

| 5

SESSION

ABSTRACT

Page 6: Image Slider with SharePoint 2013 Search Results Web Part

SPS OTTAWA

IntroductionSearch Results Web Part vs. Content Search Web PartConfiguring your image source and returning resultsUsing display templates

What’s a display templateDifferent typesExample

Putting together the sliderUsing a slider pluginDemo: Building the display templatesDemo: Configuring the Search Results Web Part

Conclusion

| 6

SESSION

OUTLINE

Page 7: Image Slider with SharePoint 2013 Search Results Web Part

SPS OTTAWA

INTRODUCTION

| 7

Page 8: Image Slider with SharePoint 2013 Search Results Web Part

SPS OTTAWA

A slider component is a common requirement for web sitesEnterprise only solution offered by OOTB SharePointNot available in all of the Office 365 plansNot willing to spend much effort into a custom developed Web Part

| 8

PROBLEMS…

Page 9: Image Slider with SharePoint 2013 Search Results Web Part

SPS OTTAWA

Content Query Web PartXSLT

Search core results Web PartMore XSLT

Code

| 9

WHAT ABOUT SHAREPOINT 2010?

Page 10: Image Slider with SharePoint 2013 Search Results Web Part

SPS OTTAWA | 10

NO MORE XSLT PLEASE…

- <xsl:if test="string-length($SafeImageUrl) = 0 and string-length($SafeImageHtml) != 0"> - <div class="image-area-right"> <xsl:value-of disable-output-escaping="yes" select="$SafeImageHtml" /> </div> </xsl:if> - <xsl:if test="string-length($SafeImageUrl) != 0"> - <div class="image-area-right"> - <a href="{$SafeLinkUrl}" target="{$LinkTarget}">

Page 11: Image Slider with SharePoint 2013 Search Results Web Part

SPS OTTAWA

Display templates (knowledge of HTML rather that XSLT, etc.)Use the search engineNo need to open up Visual StudiosSolution available for use in all versions of SharePoint 2013

| 11

THANK YOU SHAREPOINT 2013!

Page 12: Image Slider with SharePoint 2013 Search Results Web Part

SEARCH RESULTS WEB PART VS. CONTENT SEARCH WEB PART

SPS OTTAWA | 12

Page 13: Image Slider with SharePoint 2013 Search Results Web Part

SPS OTTAWA

Different slideshow stylesNo need to configure a display template

| 13

CONTENT SEARCH WEB PART:Built-in display templates

Page 14: Image Slider with SharePoint 2013 Search Results Web Part

SPS OTTAWA | 14

CONTENT SEARCH WEB PART:Built-in slider

Page 15: Image Slider with SharePoint 2013 Search Results Web Part

SPS OTTAWA

Remember the CQWP slots in SharePoint 2010?Replaces the field names with variables – allows you to easily redefine what data to showYou can add multiple properties

| 15

CONTENT SEARCH WEB PART:Property mappings

Page 16: Image Slider with SharePoint 2013 Search Results Web Part

SPS OTTAWA

Specify the number of items to show in the resultsOdd behavior

| 16

CONTENT SEARCH WEB PART:Honorable mention… “number of items”

Page 17: Image Slider with SharePoint 2013 Search Results Web Part

SPS OTTAWA

If you have access to it and it meets your requirements, why notIf not, the Search Results Web Part is a worthy alternativeMost of the functionalities in the CSWP are found in the SRWPIf you think the built-in slideshow is ugly, you still have to create your own display template

| 17

SO, IS THE CONTENT SEARCH WEB PART WORTH IT?

Page 18: Image Slider with SharePoint 2013 Search Results Web Part

SPS OTTAWA

CONFIGURING YOUR IMAGE SOURCE

| 18

Page 19: Image Slider with SharePoint 2013 Search Results Web Part

SPS OTTAWA

Preconfigured content typesThumbnail view

| 19

USE A PICTURE / ASSET LIBRARY

Page 20: Image Slider with SharePoint 2013 Search Results Web Part

SPS OTTAWA | 20

CRAWL THE CONTENT…

Page 21: Image Slider with SharePoint 2013 Search Results Web Part

SPS OTTAWA

DEMO: CONFIGURE YOUR SEARCH RESULTS WEB PART

| 21

Page 22: Image Slider with SharePoint 2013 Search Results Web Part

SPS OTTAWA

DISPLAY TEMPLATES

| 22

Page 23: Image Slider with SharePoint 2013 Search Results Web Part

SPS OTTAWA

No more XSLT; replaced with HTML and JavaScriptUses managed properties to show informationStored in “~sitecollection/_catalogs/masterpage/Display Templates”

| 23

WHAT’S A DISPLAY TEMPLATE?

Page 24: Image Slider with SharePoint 2013 Search Results Web Part

SPS OTTAWA

ControlSimilar to ContentQueryMain.xsl for the Content Query Web PartActs as a container for the itemsCalls Render Items

| 24

TYPES OF DISPLAY TEMPLATES:Control Template

Page 25: Image Slider with SharePoint 2013 Search Results Web Part

SPS OTTAWA | 25

OVERVIEW

Page 26: Image Slider with SharePoint 2013 Search Results Web Part

SPS OTTAWA

ItemSimilar to the itemstyle.xslRenders a single itemContains the Managed Metadata property bindings

| 26

TYPES OF DISPLAY TEMPLATES:Item Template

Page 27: Image Slider with SharePoint 2013 Search Results Web Part

SPS OTTAWA | 27

OVERVIEW

Page 28: Image Slider with SharePoint 2013 Search Results Web Part

SPS OTTAWA

GroupUsed for result blocks like Promoted results (Best Bets)Difficult to configure.On one available OOB

FilterUsed in the refinements web partExample: Range Slider

| 28

TYPES OF DISPLAY TEMPLATES:Group and Filter Templates

Page 29: Image Slider with SharePoint 2013 Search Results Web Part

SPS OTTAWA | 29

OVERVIEW

Page 30: Image Slider with SharePoint 2013 Search Results Web Part

SPS OTTAWA | 30

EXAMPLE OF AN ITEM TEMPLATE

Page 31: Image Slider with SharePoint 2013 Search Results Web Part

SPS OTTAWA

PUTTING TOGETHER THE SLIDER

| 31

Page 32: Image Slider with SharePoint 2013 Search Results Web Part

SPS OTTAWA

Leverage existing plugin instead of coding your ownFreedom to select the plugin that best suites your needsIntegrate the plugin structure into your Display Templates

HTML, JavaScript, and JavaScript framework (JQuery)

We chose SlidesJS (http://slidesjs.com/)Previous experienceKnowledge of JQueryReliable – Author keeps it up to date

| 32

USING A SLIDER PLUGIN

Page 33: Image Slider with SharePoint 2013 Search Results Web Part

SPS OTTAWA

DEMO: BUILDING THE DISPLAY TEMPLATES

| 33

Page 34: Image Slider with SharePoint 2013 Search Results Web Part

SPS OTTAWA

DEMO: CONFIGURING THE SEARCH RESULTS WEB PART

| 34

Page 35: Image Slider with SharePoint 2013 Search Results Web Part

SPS OTTAWA

CONCLUSION

| 35

Page 36: Image Slider with SharePoint 2013 Search Results Web Part

SPS OTTAWA

Use the Search Results Web Part when:You don’t have access to SharePoint 2013 EnterpriseThe OOTB slider packaged with the Content Search Web Part just doesn’t cut it

No more XSLTSome HTML and JavaScript knowledge needed

| 36

WHAT TO REMEMBER

Page 37: Image Slider with SharePoint 2013 Search Results Web Part

Join us for SharePint today!

Date & Time: Nov 23rd, 2013 @6:00 pmLocation: The Observatory Pub,

Algonquin Student’s Association

Address: A-170 on Algonquin CampusParking: No need to move your car!*

Site: http://www.algonquinsa.com/ob.aspx

*Please drive responsibly! We are happy to call you a cab

Remember to fill out your evaluation forms to win some great prizes!

&