SlideShare une entreprise Scribd logo
1  sur  15
Everything you need to know to get started and beyond +/- 50% 
Mikael Svenson 
22 August 2014 
DNV GL © 2014 
DRAFT 
22 August 2014 SAFER, SMARTER, GREENER 
SOFTWARE 
SharePoint - Display Templates 
1
What are Display Templates? 
 Defines the visual layout of search results 
 HTML -> JavaScript file 
 Client side rendering – meaning it is your browser which renders the markup 
 On first call all data is included on the page itself, subsequent calls use AJAX 
– CSWP can load async on first load as well 
DNV GL © 2014 
DRAFT 
22 August 2014 
2
What does it do? 
 Uses managed properties 
 Uses HTML and JavaScript to display content 
DNV GL © 2014 
DRAFT 
22 August 2014 
3
Logical structure (image borrowed with permission ) 
DNV GL © 2014 
DRAFT 
22 August 2014 
4
Where are they used? 
DNV GL © 2014 
DRAFT 
22 August 2014 
5
Web parts which use Display Templates 
DNV GL © 2014 
DRAFT 
22 August 2014 
 Search Box 
 Refinement (Control + Item) 
 Search Result 
– Control 
– Item 
– Group (harder to change) 
 Content By Search 
– Control 
– Item 
6
Where are the templates located? 
 Located in each site collection 
– /_catalogs/masterpage/Display Templates 
DNV GL © 2014 
DRAFT 
22 August 2014 
7
DNV GL © 2014 
DRAFT 
22 August 2014 
Gotcha’s 
 Remember to publish and approve 
8
A template may be used for multiple things 
 Re-use template for Search Result and CSWP 
DNV GL © 2014 
DRAFT 
22 August 2014 
9
What triggers a Display Template to be used? 
 Hard coded in web part 
– Common mistake 
Trigger Conditions 
DNV GL © 2014 
DRAFT 
22 August 2014 
 Result Type 
– Best practise 
10 
Display Template
Best Practise for Web Part Setup 
DNV GL © 2014 
DRAFT 
22 August 2014 
11 
Web Part 
Result 
Source 
(Scope) 
Result Type 
Item 
Template 
Control 
Template
Web Part Query Setup 
DNV GL © 2014 
DRAFT 
22 August 2014 
12 
Pick a result source 
Define the query as a 
result source instead 
Much easier to 
change – no page 
edit required
Include custom Script/CSS 
 Include custom CSS/JS in the control templates 
– Executed before results are rendered 
 Execute JavaScript after your results are rendered 
DNV GL © 2014 
DRAFT 
22 August 2014 
13 
ctx.OnPostRender = []; 
ctx.OnPostRender.push(function(){ 
<your code> 
});
Mapping Crawled Properties to Managed Properties 
 Use RefinableXXYY – easier to locate and maintain – and give them aliases 
– Decide if it should be a global property (SSA) or for a specific site collection 
 Best Bet implementation has a managed property which is an exception 
DNV GL © 2014 
DRAFT 
22 August 2014 
– NoRecall 
 Use in templates 
<mso:ManagedPropertyMapping 
msdt:dt="string">'bestbetTitleOWSTEXT':'VerIT.bestbetTitleOWSTEXT','bestbetDescriptionOWSMTXT':'VerIT. 
bestbetDescriptionOWSMTXT','bestbetUrlOWSTEXT':'VerIT.bestbetUrlOWSTEXT','bestbetImageUrlOWSTEXT':'Ver 
IT.bestbetImageUrlOWSTEXT'</mso:ManagedPropertyMapping> 
var bbTitle = $getItemValue(ctx,"bestbetTitleOWSTEXT").value; 
 For hover panels, be sure to include custom properties in the item template 
14
References: 
techmikael.blogspot.com 
www.eliostruyf.com 
www.dotnetmafia.com 
github.com/SPCSR 
SAFER, SMARTER, GREENER 
DNV GL © 2014 
DRAFT 
22 August 2014 
www.dnvgl.com 
15

Contenu connexe

Tendances

[Nuxeo World 2013] Roadmap 2014 - Product part
[Nuxeo World 2013] Roadmap 2014 - Product part[Nuxeo World 2013] Roadmap 2014 - Product part
[Nuxeo World 2013] Roadmap 2014 - Product part
Nuxeo
 
שי רחום קורות חיים2016
שי רחום קורות חיים2016שי רחום קורות חיים2016
שי רחום קורות חיים2016
Shay Rahum
 

Tendances (20)

GraphQL Bangkok Meetup 6.0
GraphQL Bangkok Meetup 6.0GraphQL Bangkok Meetup 6.0
GraphQL Bangkok Meetup 6.0
 
Creating Data Driven HTML5 Applications
Creating Data Driven HTML5 ApplicationsCreating Data Driven HTML5 Applications
Creating Data Driven HTML5 Applications
 
[Nuxeo World 2013] Roadmap 2014 - Product part
[Nuxeo World 2013] Roadmap 2014 - Product part[Nuxeo World 2013] Roadmap 2014 - Product part
[Nuxeo World 2013] Roadmap 2014 - Product part
 
James Zetlen - PWA Studio Integration…With You
James Zetlen - PWA Studio Integration…With YouJames Zetlen - PWA Studio Integration…With You
James Zetlen - PWA Studio Integration…With You
 
Industrial Attachment - Internship 2016
Industrial Attachment - Internship 2016Industrial Attachment - Internship 2016
Industrial Attachment - Internship 2016
 
Cloud Community Engineering - Holiday readiness
Cloud Community Engineering - Holiday readinessCloud Community Engineering - Holiday readiness
Cloud Community Engineering - Holiday readiness
 
Google cloud infrastructure workshop
Google cloud infrastructure workshopGoogle cloud infrastructure workshop
Google cloud infrastructure workshop
 
JAMstack
JAMstackJAMstack
JAMstack
 
Bodin - Hullin & Potencier - Magento Performance Profiling and Best Practices
Bodin - Hullin & Potencier - Magento Performance Profiling and Best PracticesBodin - Hullin & Potencier - Magento Performance Profiling and Best Practices
Bodin - Hullin & Potencier - Magento Performance Profiling and Best Practices
 
JAMstack WTJ
JAMstack WTJJAMstack WTJ
JAMstack WTJ
 
Google App Engine Introduction
Google App Engine IntroductionGoogle App Engine Introduction
Google App Engine Introduction
 
Building SPAs with AngularJS
Building SPAs with AngularJSBuilding SPAs with AngularJS
Building SPAs with AngularJS
 
Jacopo Nardiello - From CI to Prod: Running Magento at scale with Kubernetes
Jacopo Nardiello - From CI to Prod: Running Magento at scale with KubernetesJacopo Nardiello - From CI to Prod: Running Magento at scale with Kubernetes
Jacopo Nardiello - From CI to Prod: Running Magento at scale with Kubernetes
 
שי רחום קורות חיים2016
שי רחום קורות חיים2016שי רחום קורות חיים2016
שי רחום קורות חיים2016
 
Java Support On Google App Engine
Java Support On Google App EngineJava Support On Google App Engine
Java Support On Google App Engine
 
Rotating Banners In Drupal
Rotating Banners In DrupalRotating Banners In Drupal
Rotating Banners In Drupal
 
Bringing JAMStack to the Enterprise
Bringing JAMStack to the EnterpriseBringing JAMStack to the Enterprise
Bringing JAMStack to the Enterprise
 
Volodymyr Kublytskyi - Develop Product, Design Platform
Volodymyr Kublytskyi - Develop Product, Design PlatformVolodymyr Kublytskyi - Develop Product, Design Platform
Volodymyr Kublytskyi - Develop Product, Design Platform
 
TRAX technical highlights
TRAX technical highlightsTRAX technical highlights
TRAX technical highlights
 
Embracing the modern web using a Headless CMS with GatsbyJS CMS Philly
Embracing the modern web  using a Headless CMS with GatsbyJS CMS PhillyEmbracing the modern web  using a Headless CMS with GatsbyJS CMS Philly
Embracing the modern web using a Headless CMS with GatsbyJS CMS Philly
 

Similaire à SharePoint - Display Templates Overview

Senior .Net Developer - Senthil Ravindranath
Senior .Net Developer - Senthil RavindranathSenior .Net Developer - Senthil Ravindranath
Senior .Net Developer - Senthil Ravindranath
Senthil Ravindranath
 
Web(abap introduction)
Web(abap introduction)Web(abap introduction)
Web(abap introduction)
Kranthi Kumar
 
Prateek's Updated Resume 2016
Prateek's Updated Resume 2016Prateek's Updated Resume 2016
Prateek's Updated Resume 2016
Prateek Chaudhary
 

Similaire à SharePoint - Display Templates Overview (20)

Introduction to AngularJs
Introduction to AngularJsIntroduction to AngularJs
Introduction to AngularJs
 
Sharepoint Display templates
Sharepoint Display templatesSharepoint Display templates
Sharepoint Display templates
 
Mho Web Dynpro Abap
Mho Web Dynpro AbapMho Web Dynpro Abap
Mho Web Dynpro Abap
 
Building your own calendly using amazon app sync
Building your own calendly using amazon app syncBuilding your own calendly using amazon app sync
Building your own calendly using amazon app sync
 
The Decoupled CMS in Financial Services
The Decoupled CMS in Financial ServicesThe Decoupled CMS in Financial Services
The Decoupled CMS in Financial Services
 
Senior .Net Developer - Senthil Ravindranath
Senior .Net Developer - Senthil RavindranathSenior .Net Developer - Senthil Ravindranath
Senior .Net Developer - Senthil Ravindranath
 
Introduction to single page application with angular js
Introduction to single page application with angular jsIntroduction to single page application with angular js
Introduction to single page application with angular js
 
Drupal in 5mins + Previewing Drupal 8.x
Drupal in 5mins + Previewing Drupal 8.xDrupal in 5mins + Previewing Drupal 8.x
Drupal in 5mins + Previewing Drupal 8.x
 
Oracle soa suite 12c - News
Oracle soa suite 12c - NewsOracle soa suite 12c - News
Oracle soa suite 12c - News
 
Oracle SOA Suite 12c - News and Overview
Oracle SOA Suite 12c - News and OverviewOracle SOA Suite 12c - News and Overview
Oracle SOA Suite 12c - News and Overview
 
Web(abap introduction)
Web(abap introduction)Web(abap introduction)
Web(abap introduction)
 
SharePoint 2013 Search and Creating Dynamic Content Management Solutions
SharePoint 2013 Search and Creating Dynamic Content Management SolutionsSharePoint 2013 Search and Creating Dynamic Content Management Solutions
SharePoint 2013 Search and Creating Dynamic Content Management Solutions
 
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
 
The Cloud Operating Model MVP: From Zero to Production Ready in 12 Weeks - Bu...
The Cloud Operating Model MVP: From Zero to Production Ready in 12 Weeks - Bu...The Cloud Operating Model MVP: From Zero to Production Ready in 12 Weeks - Bu...
The Cloud Operating Model MVP: From Zero to Production Ready in 12 Weeks - Bu...
 
Oracle ADF Overview for Beginners
Oracle ADF Overview for BeginnersOracle ADF Overview for Beginners
Oracle ADF Overview for Beginners
 
Prateek's Updated Resume 2016
Prateek's Updated Resume 2016Prateek's Updated Resume 2016
Prateek's Updated Resume 2016
 
DRUPAL 7 END OF LIFE IS NEAR - MIGRATE TO DRUPAL 9 FAST AND EASY
DRUPAL 7 END OF LIFE IS NEAR - MIGRATE TO DRUPAL 9 FAST AND EASYDRUPAL 7 END OF LIFE IS NEAR - MIGRATE TO DRUPAL 9 FAST AND EASY
DRUPAL 7 END OF LIFE IS NEAR - MIGRATE TO DRUPAL 9 FAST AND EASY
 
Cloud computing & Batch processing: potentiels & perspectives
Cloud computing & Batch processing:  potentiels & perspectives  Cloud computing & Batch processing:  potentiels & perspectives
Cloud computing & Batch processing: potentiels & perspectives
 
DevOps KPIs as a Service: Daimler’s Solution
DevOps KPIs as a Service: Daimler’s SolutionDevOps KPIs as a Service: Daimler’s Solution
DevOps KPIs as a Service: Daimler’s Solution
 
Overview of the AngularJS framework
Overview of the AngularJS framework Overview of the AngularJS framework
Overview of the AngularJS framework
 

Plus de Mikael Svenson

Plus de Mikael Svenson (11)

Nyheter i O365-porteføljen og Office 2016
Nyheter i O365-porteføljen og Office 2016Nyheter i O365-porteføljen og Office 2016
Nyheter i O365-porteføljen og Office 2016
 
Office graph - Is it your cup of tea?
Office graph - Is it your cup of tea?Office graph - Is it your cup of tea?
Office graph - Is it your cup of tea?
 
SharePoint - The hybrid story and beyond
SharePoint - The hybrid story and beyondSharePoint - The hybrid story and beyond
SharePoint - The hybrid story and beyond
 
Norwegian SharePoint Community - What happened at Ignite
Norwegian SharePoint Community - What happened at IgniteNorwegian SharePoint Community - What happened at Ignite
Norwegian SharePoint Community - What happened at Ignite
 
SharePoint Search Queries Explained - SPSSthlm 2015
SharePoint Search Queries Explained - SPSSthlm 2015SharePoint Search Queries Explained - SPSSthlm 2015
SharePoint Search Queries Explained - SPSSthlm 2015
 
Techniques for Creating Social Refiners in SharePoint Search
Techniques for Creating Social Refiners in SharePoint SearchTechniques for Creating Social Refiners in SharePoint Search
Techniques for Creating Social Refiners in SharePoint Search
 
Search Queries Explained – A Deep Dive into Query Rules, Query Variables and ...
Search Queries Explained – A Deep Dive into Query Rules, Query Variables and ...Search Queries Explained – A Deep Dive into Query Rules, Query Variables and ...
Search Queries Explained – A Deep Dive into Query Rules, Query Variables and ...
 
Nsc 2013 06-17 - random rants on 2013
Nsc 2013 06-17 - random rants on 2013Nsc 2013 06-17 - random rants on 2013
Nsc 2013 06-17 - random rants on 2013
 
SharePoint Saturday Belgium - Contextual Search and More..
SharePoint Saturday Belgium - Contextual Search and More..SharePoint Saturday Belgium - Contextual Search and More..
SharePoint Saturday Belgium - Contextual Search and More..
 
Nsc 2011 09-21 search 101
Nsc 2011 09-21 search 101Nsc 2011 09-21 search 101
Nsc 2011 09-21 search 101
 
Er gratis søk egentlig noe tess
Er gratis søk egentlig noe tessEr gratis søk egentlig noe tess
Er gratis søk egentlig noe tess
 

Dernier

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Dernier (20)

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
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...
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
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
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
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...
 
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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

SharePoint - Display Templates Overview

  • 1. Everything you need to know to get started and beyond +/- 50% Mikael Svenson 22 August 2014 DNV GL © 2014 DRAFT 22 August 2014 SAFER, SMARTER, GREENER SOFTWARE SharePoint - Display Templates 1
  • 2. What are Display Templates?  Defines the visual layout of search results  HTML -> JavaScript file  Client side rendering – meaning it is your browser which renders the markup  On first call all data is included on the page itself, subsequent calls use AJAX – CSWP can load async on first load as well DNV GL © 2014 DRAFT 22 August 2014 2
  • 3. What does it do?  Uses managed properties  Uses HTML and JavaScript to display content DNV GL © 2014 DRAFT 22 August 2014 3
  • 4. Logical structure (image borrowed with permission ) DNV GL © 2014 DRAFT 22 August 2014 4
  • 5. Where are they used? DNV GL © 2014 DRAFT 22 August 2014 5
  • 6. Web parts which use Display Templates DNV GL © 2014 DRAFT 22 August 2014  Search Box  Refinement (Control + Item)  Search Result – Control – Item – Group (harder to change)  Content By Search – Control – Item 6
  • 7. Where are the templates located?  Located in each site collection – /_catalogs/masterpage/Display Templates DNV GL © 2014 DRAFT 22 August 2014 7
  • 8. DNV GL © 2014 DRAFT 22 August 2014 Gotcha’s  Remember to publish and approve 8
  • 9. A template may be used for multiple things  Re-use template for Search Result and CSWP DNV GL © 2014 DRAFT 22 August 2014 9
  • 10. What triggers a Display Template to be used?  Hard coded in web part – Common mistake Trigger Conditions DNV GL © 2014 DRAFT 22 August 2014  Result Type – Best practise 10 Display Template
  • 11. Best Practise for Web Part Setup DNV GL © 2014 DRAFT 22 August 2014 11 Web Part Result Source (Scope) Result Type Item Template Control Template
  • 12. Web Part Query Setup DNV GL © 2014 DRAFT 22 August 2014 12 Pick a result source Define the query as a result source instead Much easier to change – no page edit required
  • 13. Include custom Script/CSS  Include custom CSS/JS in the control templates – Executed before results are rendered  Execute JavaScript after your results are rendered DNV GL © 2014 DRAFT 22 August 2014 13 ctx.OnPostRender = []; ctx.OnPostRender.push(function(){ <your code> });
  • 14. Mapping Crawled Properties to Managed Properties  Use RefinableXXYY – easier to locate and maintain – and give them aliases – Decide if it should be a global property (SSA) or for a specific site collection  Best Bet implementation has a managed property which is an exception DNV GL © 2014 DRAFT 22 August 2014 – NoRecall  Use in templates <mso:ManagedPropertyMapping msdt:dt="string">'bestbetTitleOWSTEXT':'VerIT.bestbetTitleOWSTEXT','bestbetDescriptionOWSMTXT':'VerIT. bestbetDescriptionOWSMTXT','bestbetUrlOWSTEXT':'VerIT.bestbetUrlOWSTEXT','bestbetImageUrlOWSTEXT':'Ver IT.bestbetImageUrlOWSTEXT'</mso:ManagedPropertyMapping> var bbTitle = $getItemValue(ctx,"bestbetTitleOWSTEXT").value;  For hover panels, be sure to include custom properties in the item template 14
  • 15. References: techmikael.blogspot.com www.eliostruyf.com www.dotnetmafia.com github.com/SPCSR SAFER, SMARTER, GREENER DNV GL © 2014 DRAFT 22 August 2014 www.dnvgl.com 15