SlideShare ist ein Scribd-Unternehmen logo
1 von 12
© 2016 Rightpoint. All Rights Reserved.
Display Template Deep Dive
MARCH SPUG 2016
3/8/2016
© 2016 Rightpoint. All Rights Reserved.
Agenda
1. Quick Intro
2. Presentation Guidelines
3. Quick Search Overview
4. Display Template 10,000 ft. View
1. What is a Control Template?
2. What is an Item Template?
5. Into the weeds!
1. AKA lets do the fun bit which is actually building the carousel
6. Helpful Functions and Helpers
7. Display Template Gotchas
© 2016 Rightpoint. All Rights Reserved.
Introductions
Dan Adams John Ingraffia
© 2016 Rightpoint. All Rights Reserved.
Presentation Guidelines
• We are all here after work because we want
to be, so lets try and have some fun!
• Feel free to raise a hand or give a quick
shout throughout the presentation if you
have a question or want us to touch on
something again
• If a question and it is too in depth or
specific, we may ask that we circle back to
the question after the presentation
• There is plenty of pizza and drinks so feel
free to get up and get some!
© 2016 Rightpoint. All Rights Reserved.
Quick Search Overview
Admin Creates Site
Content Types & Site
Columns
Users Use The Amazing
System (Create and
Upload Content)
The search crawler looks
through all of the allowed
sites and stores the
content in Crawled &
Managed Properties
All of this data is then stored within the Search Index which acts as a reservoir of
data which can be utilized via Search, Search REST API, and Search Web Parts
© 2016 Rightpoint. All Rights Reserved.
Display Template 10,000 ft. view
• Search web parts are driven by…
‣ A Result Source: Tells the search index what data to return (aka your query)
‣ A Control Template: Acts as the container / wrapper for the content
‣ An Item Template: Determines how each individual search result is rendered
• Display Templates are built using standard web technologies
‣ HTML
‣ CSS
‣ JavaScript
‣ jQuery
‣ Angular
‣ Knockout
‣ Etc.
• You are free to use your favorite frameworks and libraries!
© 2016 Rightpoint. All Rights Reserved.
Control
Template
Item
Template
Search
Vertical
Refinement
Panel
© 2016 Rightpoint. All Rights Reserved.
Metaphor: Carton of Eggs
• The Result source would say something
along the lines of SPContentType=“Egg”
AND HasFace=“True”
• The Content By Search Web Part Settings
would allow us to say only render the first 11
items / eggs
• The Control Template is the carton /
container
• The Item Template is represented by each
egg / result
© 2016 Rightpoint. All Rights Reserved.
Syntax To Call Managed Properties
$getItemValue(ctx, “managed prop or display name”
• This call will actually change a property to
the correct data type based upon the auto
generated suffix that is created for Managed
Property via SharePoint Site Column
Creation
‣ i.e DiscussionLastUpdatedOWSDATE
• This call is able to change a property to the
correct type even if the managed property is
set to type text
ctx.CurrentItem.ManagedProp
• This call returns the text value of the property
• This can return data differently than the get
item value call. For instance calling a
hyperlink or picture field will return the data
as “url, display name”
© 2016 Rightpoint. All Rights Reserved.
Into The Weeds!
© 2016 Rightpoint. All Rights Reserved.
The Gotchas
• Calling anything on a null value that has not
been handled
‣ i.e. calling .length on a null property will
cause your entire Content By Search web
part to error out
• ctx.CurrentItem and $getItemValue can
return different results
‣ As an example: a hyperlink / picture field will
return url, displayName and the other method
will return the hyperlinked displayName
• Check to see if there is a function for what
you need before reinventing the wheel
‣ i.e. writing a huge switch statement for
document icon to find out later you could
have just used:
Srch.U.getIconUrlByFileExtension()
© 2016 Rightpoint. All Rights Reserved.
That’s all Folks!
Questions?

Weitere ähnliche Inhalte

Was ist angesagt?

Firebase - cloud based real time database
Firebase - cloud based real time databaseFirebase - cloud based real time database
Firebase - cloud based real time databaseGlenn Bech
 
Best practices: Optimizing A/B tests for SEO
Best practices: Optimizing A/B tests for SEOBest practices: Optimizing A/B tests for SEO
Best practices: Optimizing A/B tests for SEOLaurent Müllender
 
Instagram filters (8 24)
Instagram filters (8 24)Instagram filters (8 24)
Instagram filters (8 24)Ivy Rueb
 
WordCamp Tokyo 2011 komori
WordCamp Tokyo 2011 komoriWordCamp Tokyo 2011 komori
WordCamp Tokyo 2011 komorimasaaki komori
 
Firebase - A real-time server
Firebase - A real-time serverFirebase - A real-time server
Firebase - A real-time serverAneeq Anwar
 
Building Your WordPress Website Using Google Apps Engine
Building Your WordPress Website Using Google Apps EngineBuilding Your WordPress Website Using Google Apps Engine
Building Your WordPress Website Using Google Apps EngineKim Beasley
 
Isomorphic web apps with react
Isomorphic web apps with reactIsomorphic web apps with react
Isomorphic web apps with reactlarrymyers717
 
Akeneo batch Component
Akeneo batch ComponentAkeneo batch Component
Akeneo batch ComponentSylvain Rayé
 
A Beginner's Guide to Ember
A Beginner's Guide to EmberA Beginner's Guide to Ember
A Beginner's Guide to EmberRichard Martin
 
Finding the Time for Web 2.0
Finding the Time for Web 2.0Finding the Time for Web 2.0
Finding the Time for Web 2.0Anne Welsh
 
Deep Dive into the Content Query Web Part by Christina Wheeler - SPTechCon
Deep Dive into the Content Query Web Part by Christina Wheeler - SPTechConDeep Dive into the Content Query Web Part by Christina Wheeler - SPTechCon
Deep Dive into the Content Query Web Part by Christina Wheeler - SPTechConSPTechCon
 
Serverless Apps
Serverless AppsServerless Apps
Serverless Appsjoehack3r
 
Introduction to GraphQL (or How I Learned to Stop Worrying about REST APIs)
Introduction to GraphQL (or How I Learned to Stop Worrying about REST APIs)Introduction to GraphQL (or How I Learned to Stop Worrying about REST APIs)
Introduction to GraphQL (or How I Learned to Stop Worrying about REST APIs)Hafiz Ismail
 
Content query web part – get it all in one place and style it!
Content query web part – get it all in one place and style it!Content query web part – get it all in one place and style it!
Content query web part – get it all in one place and style it!Benjamin Niaulin
 
WordPress Hooks (Actions & Filters)
WordPress Hooks (Actions & Filters)WordPress Hooks (Actions & Filters)
WordPress Hooks (Actions & Filters)MuhammadKashif596
 
On site audit with screaming frog gdi
On site audit with screaming frog gdiOn site audit with screaming frog gdi
On site audit with screaming frog gdiGlen Dimaandal
 

Was ist angesagt? (20)

Firebase - cloud based real time database
Firebase - cloud based real time databaseFirebase - cloud based real time database
Firebase - cloud based real time database
 
Best practices: Optimizing A/B tests for SEO
Best practices: Optimizing A/B tests for SEOBest practices: Optimizing A/B tests for SEO
Best practices: Optimizing A/B tests for SEO
 
Cain & Obenland — Episode 4
Cain & Obenland — Episode 4Cain & Obenland — Episode 4
Cain & Obenland — Episode 4
 
Instagram filters (8 24)
Instagram filters (8 24)Instagram filters (8 24)
Instagram filters (8 24)
 
WordCamp Tokyo 2011 komori
WordCamp Tokyo 2011 komoriWordCamp Tokyo 2011 komori
WordCamp Tokyo 2011 komori
 
Firebase - A real-time server
Firebase - A real-time serverFirebase - A real-time server
Firebase - A real-time server
 
Crazylister Tutorial
Crazylister TutorialCrazylister Tutorial
Crazylister Tutorial
 
Building Your WordPress Website Using Google Apps Engine
Building Your WordPress Website Using Google Apps EngineBuilding Your WordPress Website Using Google Apps Engine
Building Your WordPress Website Using Google Apps Engine
 
Isomorphic web apps with react
Isomorphic web apps with reactIsomorphic web apps with react
Isomorphic web apps with react
 
Akeneo batch Component
Akeneo batch ComponentAkeneo batch Component
Akeneo batch Component
 
A Beginner's Guide to Ember
A Beginner's Guide to EmberA Beginner's Guide to Ember
A Beginner's Guide to Ember
 
Finding the Time for Web 2.0
Finding the Time for Web 2.0Finding the Time for Web 2.0
Finding the Time for Web 2.0
 
Deep Dive into the Content Query Web Part by Christina Wheeler - SPTechCon
Deep Dive into the Content Query Web Part by Christina Wheeler - SPTechConDeep Dive into the Content Query Web Part by Christina Wheeler - SPTechCon
Deep Dive into the Content Query Web Part by Christina Wheeler - SPTechCon
 
Serverless Apps
Serverless AppsServerless Apps
Serverless Apps
 
Introduction to GraphQL (or How I Learned to Stop Worrying about REST APIs)
Introduction to GraphQL (or How I Learned to Stop Worrying about REST APIs)Introduction to GraphQL (or How I Learned to Stop Worrying about REST APIs)
Introduction to GraphQL (or How I Learned to Stop Worrying about REST APIs)
 
One ASP.NET
One ASP.NETOne ASP.NET
One ASP.NET
 
Content query web part – get it all in one place and style it!
Content query web part – get it all in one place and style it!Content query web part – get it all in one place and style it!
Content query web part – get it all in one place and style it!
 
Ajax part i
Ajax part iAjax part i
Ajax part i
 
WordPress Hooks (Actions & Filters)
WordPress Hooks (Actions & Filters)WordPress Hooks (Actions & Filters)
WordPress Hooks (Actions & Filters)
 
On site audit with screaming frog gdi
On site audit with screaming frog gdiOn site audit with screaming frog gdi
On site audit with screaming frog gdi
 

Ähnlich wie Display template deep dive spug

Search Driven Solutions
Search Driven SolutionsSearch Driven Solutions
Search Driven SolutionsApril Dunnam
 
Best Practices: Intranet Homepage Design ppt
Best Practices: Intranet Homepage Design pptBest Practices: Intranet Homepage Design ppt
Best Practices: Intranet Homepage Design pptStanton Viaduc
 
Drew madelung sp designer workflows - sp-biz
Drew madelung   sp designer workflows - sp-bizDrew madelung   sp designer workflows - sp-biz
Drew madelung sp designer workflows - sp-bizDrew Madelung
 
Spca2014 search workshop niaulin
Spca2014 search workshop niaulinSpca2014 search workshop niaulin
Spca2014 search workshop niaulinNCCOMMS
 
Product Catalog and IT Service Management
Product Catalog and IT Service ManagementProduct Catalog and IT Service Management
Product Catalog and IT Service ManagementDrew Madelung
 
Create responsive websites with Django, REST and AngularJS
Create responsive websites with Django, REST and AngularJSCreate responsive websites with Django, REST and AngularJS
Create responsive websites with Django, REST and AngularJSHannes Hapke
 
A Power User's intro to jQuery awesomeness in SharePoint
A Power User's intro to jQuery awesomeness in SharePointA Power User's intro to jQuery awesomeness in SharePoint
A Power User's intro to jQuery awesomeness in SharePointMark Rackley
 
How we improved performance at Mixbook
How we improved performance at MixbookHow we improved performance at Mixbook
How we improved performance at MixbookAnton Astashov
 
A Power User's Intro to jQuery Awesomeness in SharePoint
A Power User's Intro to jQuery Awesomeness in SharePointA Power User's Intro to jQuery Awesomeness in SharePoint
A Power User's Intro to jQuery Awesomeness in SharePointMark Rackley
 
SharePoint Designer Workflows - Nuts, Bolts and Examples
SharePoint Designer Workflows - Nuts, Bolts and ExamplesSharePoint Designer Workflows - Nuts, Bolts and Examples
SharePoint Designer Workflows - Nuts, Bolts and ExamplesDrew Madelung
 
Migration Best Practices - SEOkomm 2018
Migration Best Practices - SEOkomm 2018Migration Best Practices - SEOkomm 2018
Migration Best Practices - SEOkomm 2018Bastian Grimm
 
Zero Budget Marketing - AdGlobal360
Zero Budget Marketing - AdGlobal360Zero Budget Marketing - AdGlobal360
Zero Budget Marketing - AdGlobal360AdGlobal360
 
From Web Site to Web App: Fantastic Optimisations and Where To Find Them
From Web Site to Web App: Fantastic Optimisations and Where To Find ThemFrom Web Site to Web App: Fantastic Optimisations and Where To Find Them
From Web Site to Web App: Fantastic Optimisations and Where To Find ThemMobileMoxie
 
SUGUK Cambridge - Display Templates & JSLink for IT Pros
SUGUK Cambridge - Display Templates & JSLink for IT ProsSUGUK Cambridge - Display Templates & JSLink for IT Pros
SUGUK Cambridge - Display Templates & JSLink for IT ProsPaul Hunt
 
SPC Master Power User SharePoint & Office 365
SPC Master Power User SharePoint & Office 365SPC Master Power User SharePoint & Office 365
SPC Master Power User SharePoint & Office 365Benjamin Niaulin
 
Sps redmond 2014 deck
Sps redmond 2014 deckSps redmond 2014 deck
Sps redmond 2014 deckDorinda Reyes
 
James Higginbotham - API Design
James Higginbotham - API DesignJames Higginbotham - API Design
James Higginbotham - API DesignJohn Zozzaro
 
Personalization How-To: Driving Conversions with Acquia Lift
Personalization How-To: Driving Conversions with Acquia LiftPersonalization How-To: Driving Conversions with Acquia Lift
Personalization How-To: Driving Conversions with Acquia LiftAcquia
 
Building the Eventbrite API Ecosystem
Building the Eventbrite API EcosystemBuilding the Eventbrite API Ecosystem
Building the Eventbrite API EcosystemMitch Colleran
 

Ähnlich wie Display template deep dive spug (20)

Search Driven Solutions
Search Driven SolutionsSearch Driven Solutions
Search Driven Solutions
 
Best Practices: Intranet Homepage Design ppt
Best Practices: Intranet Homepage Design pptBest Practices: Intranet Homepage Design ppt
Best Practices: Intranet Homepage Design ppt
 
Drew madelung sp designer workflows - sp-biz
Drew madelung   sp designer workflows - sp-bizDrew madelung   sp designer workflows - sp-biz
Drew madelung sp designer workflows - sp-biz
 
Spca2014 search workshop niaulin
Spca2014 search workshop niaulinSpca2014 search workshop niaulin
Spca2014 search workshop niaulin
 
Product Catalog and IT Service Management
Product Catalog and IT Service ManagementProduct Catalog and IT Service Management
Product Catalog and IT Service Management
 
Create responsive websites with Django, REST and AngularJS
Create responsive websites with Django, REST and AngularJSCreate responsive websites with Django, REST and AngularJS
Create responsive websites with Django, REST and AngularJS
 
A Power User's intro to jQuery awesomeness in SharePoint
A Power User's intro to jQuery awesomeness in SharePointA Power User's intro to jQuery awesomeness in SharePoint
A Power User's intro to jQuery awesomeness in SharePoint
 
How we improved performance at Mixbook
How we improved performance at MixbookHow we improved performance at Mixbook
How we improved performance at Mixbook
 
A Power User's Intro to jQuery Awesomeness in SharePoint
A Power User's Intro to jQuery Awesomeness in SharePointA Power User's Intro to jQuery Awesomeness in SharePoint
A Power User's Intro to jQuery Awesomeness in SharePoint
 
SharePoint Designer Workflows - Nuts, Bolts and Examples
SharePoint Designer Workflows - Nuts, Bolts and ExamplesSharePoint Designer Workflows - Nuts, Bolts and Examples
SharePoint Designer Workflows - Nuts, Bolts and Examples
 
Migration Best Practices - SEOkomm 2018
Migration Best Practices - SEOkomm 2018Migration Best Practices - SEOkomm 2018
Migration Best Practices - SEOkomm 2018
 
Zero Budget Marketing - AdGlobal360
Zero Budget Marketing - AdGlobal360Zero Budget Marketing - AdGlobal360
Zero Budget Marketing - AdGlobal360
 
From Web Site to Web App: Fantastic Optimisations and Where To Find Them
From Web Site to Web App: Fantastic Optimisations and Where To Find ThemFrom Web Site to Web App: Fantastic Optimisations and Where To Find Them
From Web Site to Web App: Fantastic Optimisations and Where To Find Them
 
SUGUK Cambridge - Display Templates & JSLink for IT Pros
SUGUK Cambridge - Display Templates & JSLink for IT ProsSUGUK Cambridge - Display Templates & JSLink for IT Pros
SUGUK Cambridge - Display Templates & JSLink for IT Pros
 
SPC Master Power User SharePoint & Office 365
SPC Master Power User SharePoint & Office 365SPC Master Power User SharePoint & Office 365
SPC Master Power User SharePoint & Office 365
 
Sps redmond 2014 deck
Sps redmond 2014 deckSps redmond 2014 deck
Sps redmond 2014 deck
 
James Higginbotham - API Design
James Higginbotham - API DesignJames Higginbotham - API Design
James Higginbotham - API Design
 
Personalization How-To: Driving Conversions with Acquia Lift
Personalization How-To: Driving Conversions with Acquia LiftPersonalization How-To: Driving Conversions with Acquia Lift
Personalization How-To: Driving Conversions with Acquia Lift
 
Building the Eventbrite API Ecosystem
Building the Eventbrite API EcosystemBuilding the Eventbrite API Ecosystem
Building the Eventbrite API Ecosystem
 
Cqrs api
Cqrs apiCqrs api
Cqrs api
 

Kürzlich hochgeladen

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Kürzlich hochgeladen (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

Display template deep dive spug

  • 1. © 2016 Rightpoint. All Rights Reserved. Display Template Deep Dive MARCH SPUG 2016 3/8/2016
  • 2. © 2016 Rightpoint. All Rights Reserved. Agenda 1. Quick Intro 2. Presentation Guidelines 3. Quick Search Overview 4. Display Template 10,000 ft. View 1. What is a Control Template? 2. What is an Item Template? 5. Into the weeds! 1. AKA lets do the fun bit which is actually building the carousel 6. Helpful Functions and Helpers 7. Display Template Gotchas
  • 3. © 2016 Rightpoint. All Rights Reserved. Introductions Dan Adams John Ingraffia
  • 4. © 2016 Rightpoint. All Rights Reserved. Presentation Guidelines • We are all here after work because we want to be, so lets try and have some fun! • Feel free to raise a hand or give a quick shout throughout the presentation if you have a question or want us to touch on something again • If a question and it is too in depth or specific, we may ask that we circle back to the question after the presentation • There is plenty of pizza and drinks so feel free to get up and get some!
  • 5. © 2016 Rightpoint. All Rights Reserved. Quick Search Overview Admin Creates Site Content Types & Site Columns Users Use The Amazing System (Create and Upload Content) The search crawler looks through all of the allowed sites and stores the content in Crawled & Managed Properties All of this data is then stored within the Search Index which acts as a reservoir of data which can be utilized via Search, Search REST API, and Search Web Parts
  • 6. © 2016 Rightpoint. All Rights Reserved. Display Template 10,000 ft. view • Search web parts are driven by… ‣ A Result Source: Tells the search index what data to return (aka your query) ‣ A Control Template: Acts as the container / wrapper for the content ‣ An Item Template: Determines how each individual search result is rendered • Display Templates are built using standard web technologies ‣ HTML ‣ CSS ‣ JavaScript ‣ jQuery ‣ Angular ‣ Knockout ‣ Etc. • You are free to use your favorite frameworks and libraries!
  • 7. © 2016 Rightpoint. All Rights Reserved. Control Template Item Template Search Vertical Refinement Panel
  • 8. © 2016 Rightpoint. All Rights Reserved. Metaphor: Carton of Eggs • The Result source would say something along the lines of SPContentType=“Egg” AND HasFace=“True” • The Content By Search Web Part Settings would allow us to say only render the first 11 items / eggs • The Control Template is the carton / container • The Item Template is represented by each egg / result
  • 9. © 2016 Rightpoint. All Rights Reserved. Syntax To Call Managed Properties $getItemValue(ctx, “managed prop or display name” • This call will actually change a property to the correct data type based upon the auto generated suffix that is created for Managed Property via SharePoint Site Column Creation ‣ i.e DiscussionLastUpdatedOWSDATE • This call is able to change a property to the correct type even if the managed property is set to type text ctx.CurrentItem.ManagedProp • This call returns the text value of the property • This can return data differently than the get item value call. For instance calling a hyperlink or picture field will return the data as “url, display name”
  • 10. © 2016 Rightpoint. All Rights Reserved. Into The Weeds!
  • 11. © 2016 Rightpoint. All Rights Reserved. The Gotchas • Calling anything on a null value that has not been handled ‣ i.e. calling .length on a null property will cause your entire Content By Search web part to error out • ctx.CurrentItem and $getItemValue can return different results ‣ As an example: a hyperlink / picture field will return url, displayName and the other method will return the hyperlinked displayName • Check to see if there is a function for what you need before reinventing the wheel ‣ i.e. writing a huge switch statement for document icon to find out later you could have just used: Srch.U.getIconUrlByFileExtension()
  • 12. © 2016 Rightpoint. All Rights Reserved. That’s all Folks! Questions?

Hinweis der Redaktion

  1. 'Project Role'{Project Role}:'RefinableString06'