content in sharepoint 2013 eric overfield sharepoint advocate and enthusiast pixelmill integrating...
TRANSCRIPT
Content in SharePoint 2013
Eric OverfieldSharePoint Advocate and Enthusiast
PixelMill
Integrating Search Driven
Introduction – Eric Overfield
Founder and SharePoint Branding/UI Lead,
PixelMill
Speaker, Teacher, Advocate
Author, SharePoint Community Organizer
Located in Davis, CA
ericoverfield.com
@EricOverfield
Order Your Copy http://pxml.ly/zsqykd
Co-author: “Pro SharePoint 2013 Branding and
Responsive Web Development” (Apress – June
12th, 2013)
Co-author: “Black Magic
Solutions for White Hat
SharePoint” (August, 2013)
What You Will Learn
Aggregate Content Across Sitescross-site publishing feature
Create Content Rollup Solutionscustom display templates
Customize Individual Search Results
result types
Fine-tune Search Queriesquery rules
@EricOverfield - pixelmill.com
Aggregate Content
Across Site(s)@EricOverfield - pixelmill.com
@EricOverfield - pixelmill.com
Site Collection A
Search
Search Crawl
Content Query Web Part (CBQ)
Site Collection A
The Old Way
Site Collection B
Search
Search Crawl
Content Query Web Part (CBQ)
Site Collection B
@EricOverfield - pixelmill.com
Site Collection A
SearchSearch Crawl
Content Search Web Part
Site Collection B
Site Collection C
Site Collection D
List of articles/documentsRecommendationsPopular items
The SharePoint 2013 Way
Demo Solution: What We Want to Build…
Scenario:
Show dynamic content
Show potential buyers
a rollup of all the
available Specter
Group properties for
sale
@EricOverfield - pixelmill.com
@EricOverfield - pixelmill.com
Solution
Hold On… Important Prerequisites
Enterprise License Required
For Catalog creation and CBS
Depends on Search Indexer
@EricOverfield - pixelmill.com
Source site collection feature,
Cross-Site Collection Publishing must be
activated On-prem only – No O365 support yet
And Limitations
Consuming site requires restricted read access on
authoring site
Because results can be security trimmed Cross site publishing only supports pages and lists
@EricOverfield - pixelmill.com
Content assets (videos, images, etc.) need to be on
assets site
Use Suggested Content Browser Location Results based on search index freshness
What About Content Deployment?
Very different approach
Must be across content databases
@EricOverfield - pixelmill.com
Not based on search
May be used for similar reasons,
but apples to oranges comparison
Push NotificationsLet’s See a ComparisonMy Content
@EricOverfield - pixelmill.com
Store it anywhere, across site
collections,
web applications or farms
Create a catalog
@EricOverfield - pixelmill.com
Managed Properties
Configured in Central Admin or Site
Collection
Search Schema Content has to have been crawled
@EricOverfield - pixelmill.com
Another full crawl after a new managed
property
Required to surface/retrieve new content
columns
Push NotificationsLet’s See a ComparisonCreating Managed Properties
@EricOverfield - pixelmill.com
Push NotificationsLet’s See a ComparisonGetting Content from a Catalog
@EricOverfield - pixelmill.com
1
2
3
Push NotificationsLet’s See a ComparisonAggregate Content Review
@EricOverfield - pixelmill.com
We have source content -> catalog, stored anywhere (almost)Content has been crawled
Managed properties have been created
Prerequisites have been addressed (licenses and features)
Content has been crawled - again
Consuming site has been connected to catalog
Ready to display!
Content Rollup with the
Content Search Web Part
@EricOverfield - pixelmill.com
@EricOverfield - pixelmill.com
The Content Search Web Part
(CBS)Getting the results:
Query Builder
Showing the results: Display Templates
Push NotificationsLet’s See a ComparisonGet Dynamic Content with Query Builder
@EricOverfield - pixelmill.com
1
2 3
Push NotificationsLet’s See a ComparisonShow Dynamic Content with Display Templates
@EricOverfield - pixelmill.com
Customize YourDisplay
Templates!@EricOverfield - pixelmill.com
Push NotificationsLet’s See a ComparisonWhat Makes up a Display Template?
@EricOverfield - pixelmill.com
Control template
Item Template
HTML and JS
No more XSLT!
Retrieves Managed Properties
Push NotificationsLet’s See a ComparisonCustom Display Templates
@EricOverfield - pixelmill.com
Add to Master
Page Gallery
Copy from an
existing display template
Use any editor
Implementing Custom Display Templates
Must specify all managed properties to surface
May externalize CSS and JS that template
needs
@EricOverfield - pixelmill.com
Inline JS must appear after the first <div>
Add HTML markup to render results
Push NotificationsLet’s See a ComparisonA Look at the Code: Item Template
@EricOverfield - pixelmill.com
<mso:ManagedPropertyMapping msdt:dt="string"> 'LastModifiedTime':'LastModifiedTime', 'Specter Property Type'{Specter Property Type}:'SpecterPropertyType', 'Picture URL'{Picture URL}:'PublishingImage;PictureURL;PictureThumbnailURL', 'Link URL'{Link URL}:'Path', 'Line 1'{Line 1}:'Title', 'Line 2'{Line 2}:'Description', 'SecondaryFileExtension', 'ContentTypeId'</mso:ManagedPropertyMapping>
Obtain Managed Properties
Push NotificationsLet’s See a ComparisonA Look at the Code: Item Template
@EricOverfield - pixelmill.com
Load Managed Properties into
JavaScript Variables
var specterPropertyType = $getItemValue(ctx, "SpecterPropertyType");
var lastModifiedTime = $getItemValue(ctx, "LastModifiedTime");
Push NotificationsLet’s See a ComparisonA Look at the Code: Item Template
@EricOverfield - pixelmill.com
Display JavaScript Variables with
HTML Markup<span class="_#= specterPropertyType=#_"> <a href="_#= linkURL =#_" class="thumb"> _#= pictureMarkup =#_ <div class="date"> <div class="d">_#= date=#_</div> <div class="m">_#= month=#_</div> </div> </a> <div class="caption">Property Type: _#=
specterPropertyType=#_</div></span>
@EricOverfield - pixelmill.com
Display Components and Their
MappingsComponent Type File SharePoint Artifacts
Style for the entire result set block and for each search result item
CSS style.cssCSS file in the Master Page Gallery:
/Spectergroup/css/style.css
Structure for the entire block of results
HTML tag: <ul>
Control_List_Specter
Custom Control display template in the Master Page Gallery:
/Display Templates/Content Web Part/Control_List_Specter.html
Display content for each result item
HTML tag: <li>
Item_LargePicture_Specter
Custom Item display template in the Master Page Gallery:
/Display Templates/Content Web Part/Item_LargePicture_Specter.html
Pre-process data for each result item
JavaScriptInline JavaScript in Item_LargePicture_Specter
Custom Item display template in the Master Page Gallery:
/Display Templates/Content Web Part/Item_LargePicture_Specter.html
Push NotificationsLet’s See a ComparisonDisplay Templates Review
@EricOverfield - pixelmill.com
Add managed properties to top of display template
Customize with HTML, JavaScript and CSS
Copy an existing display template
That is SharePoint 2013
Content Rollup
in a Nutshell@EricOverfield - pixelmill.com
OK?
Fine Tune Search Results
and Content Rollups
@EricOverfield - pixelmill.com
Target IndividualResult Items!
@EricOverfield - pixelmill.com
Push NotificationsLet’s See a ComparisonQuick Test
@EricOverfield - pixelmill.com
Wait, what, a Test?
Find the PDF
Find Joanna’s Project
The Problem
Results all look the same
But all documents/results are not the
same
@EricOverfield - pixelmill.com
Forces us to search our results
Demo Solution: What We Want to Build…
Scenario:
Customize Search
Experience
When user searches for “floor
plans”
Customize floor plans result
type as best bets
Promote beachfront
properties in the summer
Result Types
Tailor the look of important types of
results
@EricOverfield - pixelmill.com
One of these things… is not like the other.
Result Types
Conditions match result properties
Identify a “type” of result
Display Templates can change the look
Of a “type” of result
@EricOverfield - pixelmill.com
Your Own Result Type
@EricOverfield - pixelmill.com
1
2
@EricOverfield - pixelmill.com
And Thus Styled
Query Rules
Custom results based on intent
May be created at various levels
Search Service App or Site Collection and
inherited
@EricOverfield - pixelmill.com
May be deactivate at child levels
Create a Query Rule
Condition: Set of conditions to match to fire
rule
Action: What to do when rule fired
@EricOverfield - pixelmill.com
Publishing: When should a rule be active
One or more conditions per rule
Six types of conditions available
One or more actions per rule
Six types of actions available
i.e. only during a certain time span
Your Own Query Rule
Add a Summer Promotion for Beachfront
Properties
@EricOverfield - pixelmill.com
@EricOverfield - pixelmill.com
@EricOverfield - pixelmill.com
@EricOverfield - pixelmill.com
And Thus Promoted
Push NotificationsLet’s See a ComparisonResult Types and Query Rules Review
@EricOverfield - pixelmill.com
Result Types Match Conditions to Item Display TemplatesQuery Rules Match Conditions with Actions
What You Did Learn
Aggregate Content Across Sitescross-site publishing feature
Create Content Rollup Solutionscustom display templates
Customize Individual Search Results
result types
Fine-tune Search Queriesquery rules
@EricOverfield - pixelmill.com
Resources
Configure cross-site publishing in SharePoint 2013:http://technet.microsoft.com/en-us/library/jj656774.aspx
Understanding the display template structure:
http://msdn.microsoft.com/en-us/library/jj945138.aspx#bk_DTstructure
Display template reference in SharePoint Server 2013:
http://technet.microsoft.com/en-us/library/jj944947.aspx
Administer search in SharePoint Server 2013:
http://technet.microsoft.com/en-us/library/ee792877.aspx
Connect a publishing site to a catalog:
http://technet.microsoft.com/en-us/library/jj679901.aspx
Make a query rule inactive:
http://technet.microsoft.com/en-us/library/
jj871014.aspx#BKMK_MakeInactiveCustomize search result types:
http://technet.microsoft.com/en-us/library/dn135239.aspx
Create query rules:
http://technet.microsoft.com/en-us/library/jj871014.aspx
@EricOverfield - pixelmill.com
Content in SharePoint 2013
Integrating Search Driven
Thank YouEric Overfield
@EricOverfieldericoverfield.com