SharePoint 2013 Content search web part - Get it all in one place and style it!

36
Benjamin Niaulin Presented at: SharePoint Saturday St-Louis SharePoint Geek Content Search Web Part – Get it all in one place and style it!

description

This session was presented first in St. Louis. It's hard to get it by just reading the slides as much of it is through the presentation in person. Hope it helps

Transcript of SharePoint 2013 Content search web part - Get it all in one place and style it!

Page 1: SharePoint 2013 Content search web part - Get it all in one place and style it!

Benjamin NiaulinPresented at: SharePoint Saturday St-Louis

SharePoint Geek

Content Search Web Part – Get it all in one place and style it!

Page 2: SharePoint 2013 Content search web part - Get it all in one place and style it!

Share-gate.com@bniaulin

Description

We've always been limited to show items and documents from our current site or Site Collection. In SharePoint 2013, a new Web Part will make it easier to grab everything and style it the way you want. In this session, you will learn what this Web Part can do, the various scenarios where it will help as well as how to change the display of the results. Don't stay constrained to your SharePoint site - Search it!

Page 3: SharePoint 2013 Content search web part - Get it all in one place and style it!

Share-gate.com@bniaulin

Who is this guy talking?

Benjamin NiaulinSpeaker, Trainer, Consultant, SCRUM MasterBlog

bniaulin.wordpress.comWebsite

share-gate.comEmail

[email protected]!: @bniaulin

Page 4: SharePoint 2013 Content search web part - Get it all in one place and style it!

4 | SharePoint Saturday St. Louis 2013

Session Evaluations Schedule and evaluate each session you attend via our

mobile app that can be used across devices at http://spsaturday. azurewebsites.net

You will be able to evaluate sessions added to your “My Sessions” 25 minutes before the scheduled end time

Evaluations are stored anonymously and your feedback is appreciated

The app will be the only method available to submit session evaluations for the event and we hope you find it intuitive and convenient

Page 5: SharePoint 2013 Content search web part - Get it all in one place and style it!

5 | SharePoint Saturday St. Louis 2013

Housekeeping Follow SharePoint Saturday St. Louis on

Twitter @spsstlouis and hashtag #spsstl Play “Sponsor Bingo” to register for your

chance to win one of the many great giveaways at the end of the day

Schedule and evaluate each session you attend via our mobile app that can be used across devices at http://spsaturday. azurewebsites.net

Page 6: SharePoint 2013 Content search web part - Get it all in one place and style it!

6 | SharePoint Saturday St. Louis 2013

Thanks to Our Sponsors!

Gold Silver Raffle

Page 7: SharePoint 2013 Content search web part - Get it all in one place and style it!

Share-gate.com@bniaulin

Agenda

Introduction – Problems and Previous SolutionsBasics of Search 2013Content Search Web Part – Intro

Introduction DemoOverview of the Query BuilderDisplay TemplatesExisting Content Search in SP2013

LicensingOther solutions?Cool Ideas – What this means for 2013

Page 8: SharePoint 2013 Content search web part - Get it all in one place and style it!

INTRODUCTION

Page 9: SharePoint 2013 Content search web part - Get it all in one place and style it!

Share-gate.com@bniaulin

Problems we face

Showing data from multiple lists/libraries at the same time

Change the date format in a list/library

Contextual Results

Changing the look of what we are seeing

Accessing information from other Site Collections

Page 10: SharePoint 2013 Content search web part - Get it all in one place and style it!

Share-gate.com@bniaulin

Previous Solutions

Content Query Web Part

Search Coding

Page 11: SharePoint 2013 Content search web part - Get it all in one place and style it!

Share-gate.com@bniaulin

Wonderful XSLT    <xsl:template name="dvt_1.noKeyword">        <span class="srch-description2">            <xsl:choose>                <xsl:when test="$IsFixedQuery">                    <xsl:value-of select="$NoFixedQuery" />                </xsl:when>                <xsl:otherwise>                    <xsl:value-of select="$NoKeyword" />                </xsl:otherwise>            </xsl:choose>        </span>    </xsl:template>      <!-- When empty result set is returned from search -->    <xsl:template name="dvt_1.empty">        <div class="srch-results">             <xsl:if test="string-length($SrchRSSLink) &gt; 0 and $ShowActionLinks">                <a type="application/rss+xml" href ="{$SrchRSSLink}" title="{$SrchRSSText}" id="SRCHRSSL" class="srch-ext-action-margin">                    <img style="vertical-align: middle;" border="0" src="/_layouts/images/rss.gif" alt=""/>                    <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>                    <xsl:value-of select="$SrchRSSText"/>                </a>                <xsl:if test="string-length($SearchProviderLink) &gt; 0">                    |                    <a href ="{$SearchProviderLink}" title="{$SearchProviderText}" class="srch-ext-action-margin" >                        <img style="vertical-align: middle;" border="0" src="/_layouts/images/searchfolder.png" alt=""/>                        <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>                        <xsl:value-of select="$SearchProviderText"/>                    </a>                </xsl:if>            </xsl:if>        </div> 

Page 12: SharePoint 2013 Content search web part - Get it all in one place and style it!

BASICS OF SEARCH 2013

Page 13: SharePoint 2013 Content search web part - Get it all in one place and style it!

Share-gate.com@bniaulin

What’s new?

FAST + SEARCHContinuous CrawlContent SearchDisplay Templates everywhere

HTML – no more XSLTSearch ResultsResult Sources, Result Types…. Just an overall better Search

=Search Driven Sites

Page 14: SharePoint 2013 Content search web part - Get it all in one place and style it!

CONTENT SEARCH

Page 15: SharePoint 2013 Content search web part - Get it all in one place and style it!

Share-gate.com@bniaulin

Introduction to the Web Part

SearchSearch Crawl

Content Search Web Part

Site Collection A

Site Collection B

Page 16: SharePoint 2013 Content search web part - Get it all in one place and style it!

Share-gate.com@bniaulin

What is it made of?

The Content Search Web Part is essentially 2 things

1. Query Builder

2. Display Templates

Page 17: SharePoint 2013 Content search web part - Get it all in one place and style it!

Share-gate.com@bniaulin

The Query Builder

Page 18: SharePoint 2013 Content search web part - Get it all in one place and style it!

QUERY BUILDER DEMO

Page 19: SharePoint 2013 Content search web part - Get it all in one place and style it!

DISPLAY TEMPLATES

Page 20: SharePoint 2013 Content search web part - Get it all in one place and style it!

Share-gate.com@bniaulin

Overview

http://sharepoint.microsoft.com/blog/Pages/BlogPost.aspx?pID=1041

Page 21: SharePoint 2013 Content search web part - Get it all in one place and style it!

Share-gate.com@bniaulin

What it does

Stored in “~sitecollection/_catalogs/masterpage/Display Templates/”Provides reusable displays for your ContentNO MORE XSLT! HTML and JavascriptUses “Managed Properties” to show the content in right <div>

Page 22: SharePoint 2013 Content search web part - Get it all in one place and style it!

Share-gate.com@bniaulin

Categories of Display Templates

ControlSimilar to ContentQueryMain.xsl

Filter, Group and Hover PanelSimilar to Header.xsl +more

ItemSimilar to itemstyle.xsl

Page 23: SharePoint 2013 Content search web part - Get it all in one place and style it!

Share-gate.com@bniaulin

Control

The container for the “Groups, Filters and Items” to comeBest way to reference custom files (JavaScript, CSS, etc…)

Page 24: SharePoint 2013 Content search web part - Get it all in one place and style it!

Share-gate.com@bniaulin

Item

Controls what happens to each item rendered through the queryUse Managed Properties to show the content you want where you want using HTML

Page 25: SharePoint 2013 Content search web part - Get it all in one place and style it!

Share-gate.com@bniaulin

Editing a Display Template

Always comes in 2; a HTML and JS fileNEVER edit the JS file – it is automatically generated

Page 26: SharePoint 2013 Content search web part - Get it all in one place and style it!

Share-gate.com@bniaulin

Editing a Display Template (2)

Very easy to understand and manipulate compared to XSLT

Always best to copy an existing and work from thereRemember to only copy the HTML file, the JS is generatedDemo!

Page 27: SharePoint 2013 Content search web part - Get it all in one place and style it!

PREBUILT

Page 28: SharePoint 2013 Content search web part - Get it all in one place and style it!

Share-gate.com@bniaulin

Prebuilt Content Searches

Microsoft SharePoint offers prebuilt Content Search Web Parts for specific scenarios

Page 29: SharePoint 2013 Content search web part - Get it all in one place and style it!

LICENSING

Page 30: SharePoint 2013 Content search web part - Get it all in one place and style it!

Share-gate.com@bniaulin

Not available everywhere

Only available on SharePoint 2013 Enterprise

Page 31: SharePoint 2013 Content search web part - Get it all in one place and style it!

OTHER SOLUTIONS?

Page 33: SharePoint 2013 Content search web part - Get it all in one place and style it!

WHAT THIS MEANS

Page 34: SharePoint 2013 Content search web part - Get it all in one place and style it!

Share-gate.com@bniaulin

Cool!

Create dynamic Home Pages or Collaboration SitesRender an entire Web Page through Content Search

Web Page is a Search Result contextual to the user!Cool!

Page 35: SharePoint 2013 Content search web part - Get it all in one place and style it!

DEMO

Page 36: SharePoint 2013 Content search web part - Get it all in one place and style it!

Share-gate.com@bniaulin

THANK YOU!

KEEP IN TOUCH ON TWITTER @BNIAULINBlog

bniaulin.wordpress.comWebsite

share-gate.comEmail

[email protected]

Benjamin Niaulin