SlideShare a Scribd company logo
Customising the SharePoint 2013 UI with
              JavaScript

                 P&M306
           Chris O‟Brien - MVP
About me
  IndependentConsultant
  Head of Development, Content and Code


  Blog: www.sharepointnutsandbolts.com
  Twitter: @ChrisO_Brien
  LinkedIn: http://uk.linkedin.com/in/
             chrisobrienmvp
Long Ago…
SharePoint 2007
CAML



SharePoint 2010
XSL
…Today
SharePoint 2010
XSL



SharePoint 2013
CSR
Terminology

                    JSLink
     Client-Side
     Rendering
       (CSR)        Display
                   Templates
Terminology               •   Lists
                          •   Fields
                          •   Web parts etc..

               JSLink
 Client-
  Side
Rendering
 (CSR)         Display
              Templates   •   Content Search web
                              part
                          •   Search hover panel
                          •   List callouts
JSLink
 Used  to transform:
   Lists
   Views
   Fields
   Web Parts
   Content types
Registering templates/running code
 The   RenderContext JS object:
   Templates collection
    – e.g. header, item, footer
    – Register with BaseViewID, ListTemplateType, ControlMode
   OnPreRender
   OnPostRender

   ListData
   ListSchema
USING JSLINK TO FORMAT A
LIST VIEW
Demo screenshot:

A SharePoint list
transformed with
JSLink (jQuery UI
accordion)
Demo screenshot:

A SharePoint field
transformed with
JSLink (simple
conditional
formatting)
Advanced CSR possibilities
 Modify   list data/schema in OnPreRender
   E.g. lookup something dynamically


 Use   SPClientRenderer.Render() to obtain HTML:
   From arbitrary data
   Outside of page context
   In AJAX methods
Customizing the Content Search
web part
Content Query vs. Content Search
               Content Query web       Content Search web part
                      part
   Latency   100% up-to-date           Depends on crawl
                                       frequency/speed
   Scope     Current site collection   Entire farm/tenancy

   Styling   XSLT                      JavaScript

   Bonuses                             Parameterisation

                                       Support for slideshow, paging
CSWP - 5 „easy to nail‟ requirements
1.   “More like this”
       (Items matching a tag)
2.   Recently changed items
3.   Most popular items
4.   “(Recent) items you may be interested in”
       (Matching current user‟s profile)
5.   “Items related to you”
       (Contributor to document)
CSWP options

       “Unique          “Reusable
      instance”         result set”
   • Configure         • Use Result
     query in web        Source (OOTB
     part properties     or custom)
The role of Managed Properties
      CSWP   has mappings to Managed Props
      for data:
CSWP and Display Templates




             These items are files in
             ~sitecollection/_catalogs/master
             page/Display Templates/
             Content Web Parts
Diagnostic item template




        Diagnostic template
         gives raw (ish) output
        Tip: configure many
         props temporarily
CUSTOMISING THE CONTENT
SEARCH WEB PART
Demo screenshot:

Content Search
web part with
default Display
Template
Demo screenshot:

Content Search
web part with
custom Display
Template
Dynamic values in query
     Several tokens available:

     {User}                    {Page}                {Site}
     • Match profile field     • Match field value   • Match current site
       e.g.                      e.g. Page.MyField     e.g. Site.Url
       User.Department


                  {Today}                 {Term}
                  • Date filtering e.g.   • Match current
                    Today-7                 managed nav
                                            term
Script/CSS in display templates
 Tools:
   $includeScript
   $includeLanguageScript
   $includeCSS

 Butconsider HTTP payload – may be better combining
 with other CSS/JS
Search hover panel
SP2013 search recap
     Result Source • Search scope on steroids

      Query Rule   • Best Bet on steroids


                   • E.g. Word doc, person, social
     Result Type     post etc.

        Display    • Visual rendering of an item
       Template
Search display templates
1.   Create the Display Template
        Copy/rename then edit 2 files:            Alternative - use
         –   Item_Something.js [HTML]              search results
         –   Item_Something_HoverPanel.js [HTML]   WP properties to
2.   Create any core search config                 map to Display
        E.g. Managed Properties, Result Source    Template

3.   Create the Result Type
Hover Panel components
Hover Panel components




        - Item_CommonHoverPanel_Body.js
        - Item_[FileType]_HoverPanel.js
Hover Panel actions
    Footer actions can
     also be
      Common
      Specific
    Gotcha! Some item
     types do not use
     Common actions
      E.g. Discussion

                    - Item_CommonHoverPanel_Actions.js
                    - Item_[FileType]_HoverPanel.js
CUSTOMISING THE SEARCH
HOVER PANEL
Demo screenshot:

Search hover
panel customized
for CAD files (i.e.
custom behaviour
for a specific
content type)
2nd demo, screenshot 1:

Adding a new action in the search hover panel
footer:
2nd demo, screenshot 2:

Clicking action fades in a textbox and button:
2nd demo, screenshot 3:

Clicking „Post‟ button posts to user‟s social
feed:
2nd demo, screenshot 4:

Message in user‟s feed:
Hover panel – lessons learnt
 Can‟t   use document.ready() – DOM is not populated
   Specify function in ctx.OnPostRender instead
   These functions are called ONCE (on first render
    [mouseover])
    – N.B. Array of functions is accessible in all files e.g. header, body,
      actions etc.


 DON‟T    delete _#= ctx.RenderBody(ctx) =#_
   This executes Item_CommonHoverPanel_Body.js
    (inheritance model)
Summary
 JavaScriptis key to many SP2013 UI elements
 Examples shown:
     Customising entire list UI
     Conditional formatting of a field
     Rendering of Content Search web part
     Customising search hover panel (inc. AJAX)
 Lots   of other possibilities too!
Thank you for attending!
www.sharepointnutsandbolts.com

@ChrisO_Brien

More Related Content

What's hot (20)

PPTX
SharePoint and the User Interface with JavaScript
Regroove
 
PPTX
Using js link and display templates
Paul Hunt
 
PPTX
SharePoint 2013 Client Side Rendering
Bill Wolff
 
PPTX
Developing branding solutions for 2013
Thomas Daly
 
PPTX
Intro to Branding SharePoint 2013
Thomas Daly
 
PPTX
Introduction to JSLink in 2013
Sparkhound Inc.
 
PPTX
Share point 2013 - Javascript Object Model
Muawiyah Shannak
 
PDF
Customizing search result in share point 2013
Chaitra Gopalakrishna
 
PPTX
Optimizing SharePoint 2010 for Internet sites
Kanwal Khipple
 
PPTX
Top 10 Performance Tips for making Your Public Facing SharePoint 2010 Site Fa...
Kanwal Khipple
 
PPTX
Things I've learnt when skinning and customizing a SharePoint 2010 Site
Justin Lee
 
PPTX
Step into the SharePoint branding world, tools and techniques
Benjamin Niaulin
 
PPTX
SharePoint 2010 for Devs
Rishu Mehra
 
PDF
Tips for share point branding
Vinod Dangudubiyyapu
 
PPTX
SharePoint 2013 Branding
Kashif Imran
 
PPTX
Branding sharepoint project
Binh Nguyen
 
PPTX
Popping the Hood: How to Create Custom SharePoint Branding by Randy Drisgill ...
SPTechCon
 
PPT
Ofc216 Shah German Webcms
Punk Rock
 
PPTX
Modern SharePoint, the Good, the Bad, and the Ugly
Bob German
 
PPTX
Web designing course bangalore
Infocampus Logics Pvt.Ltd.
 
SharePoint and the User Interface with JavaScript
Regroove
 
Using js link and display templates
Paul Hunt
 
SharePoint 2013 Client Side Rendering
Bill Wolff
 
Developing branding solutions for 2013
Thomas Daly
 
Intro to Branding SharePoint 2013
Thomas Daly
 
Introduction to JSLink in 2013
Sparkhound Inc.
 
Share point 2013 - Javascript Object Model
Muawiyah Shannak
 
Customizing search result in share point 2013
Chaitra Gopalakrishna
 
Optimizing SharePoint 2010 for Internet sites
Kanwal Khipple
 
Top 10 Performance Tips for making Your Public Facing SharePoint 2010 Site Fa...
Kanwal Khipple
 
Things I've learnt when skinning and customizing a SharePoint 2010 Site
Justin Lee
 
Step into the SharePoint branding world, tools and techniques
Benjamin Niaulin
 
SharePoint 2010 for Devs
Rishu Mehra
 
Tips for share point branding
Vinod Dangudubiyyapu
 
SharePoint 2013 Branding
Kashif Imran
 
Branding sharepoint project
Binh Nguyen
 
Popping the Hood: How to Create Custom SharePoint Branding by Randy Drisgill ...
SPTechCon
 
Ofc216 Shah German Webcms
Punk Rock
 
Modern SharePoint, the Good, the Bad, and the Ugly
Bob German
 
Web designing course bangalore
Infocampus Logics Pvt.Ltd.
 

Viewers also liked (8)

PPTX
Enhance SharePoint 2013 with Responsive Web Design
Eric Overfield
 
PPTX
JSLink for ITPros - SharePoint Saturday Jersey
Paul Hunt
 
PPTX
Chris O'Brien - Intro to Power BI for Office 365 devs (March 2017)
Chris O'Brien
 
PPTX
Enhance the Usability of Your SharePoint Site with JSLink #Collab365 #C365114...
Wendy Neal
 
PPTX
SharePoint Branding From Start to Finish
Kanwal Khipple
 
PDF
Build Killer Visuals with SharePoint 2013 Search & Display Templates
Benjamin Niaulin
 
PPTX
Secrets of successful SharePoint Intranets
Michal Pisarek
 
PPTX
Lxc – next gen virtualization for cloud intro (cloudexpo)
Boden Russell
 
Enhance SharePoint 2013 with Responsive Web Design
Eric Overfield
 
JSLink for ITPros - SharePoint Saturday Jersey
Paul Hunt
 
Chris O'Brien - Intro to Power BI for Office 365 devs (March 2017)
Chris O'Brien
 
Enhance the Usability of Your SharePoint Site with JSLink #Collab365 #C365114...
Wendy Neal
 
SharePoint Branding From Start to Finish
Kanwal Khipple
 
Build Killer Visuals with SharePoint 2013 Search & Display Templates
Benjamin Niaulin
 
Secrets of successful SharePoint Intranets
Michal Pisarek
 
Lxc – next gen virtualization for cloud intro (cloudexpo)
Boden Russell
 
Ad

Similar to Customizing the SharePoint 2013 user interface with JavaScript - Chris OBrien (20)

PPTX
Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...
Chris O'Brien
 
PDF
GDG-USAR Tech winter break 2024 USAR.pdf
raiaryan174
 
PPTX
Introduction to Content Search Web Part
Haaron Gonzalez
 
KEY
Approaches to mobile site development
Erik Mitchell
 
PPTX
Developing Branding Solutions for 2013
Thomas Daly
 
PDF
Advanced guide to develop ajax applications using dojo
Fu Cheng
 
PDF
Introduction to AngularJS
Jussi Pohjolainen
 
PPT
Search overview
Hiep Luong
 
PDF
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Lucidworks
 
PPTX
Content query web part – get it all in one place and style it!
Benjamin Niaulin
 
PPTX
Developing Branding Solutions for 2013
Thomas Daly
 
PPTX
Essentials for the SharePoint Power User - SharePoint Engage Raleigh 2017
Drew Madelung
 
PPTX
BackboneJS Training - Giving Backbone to your applications
Joseph Khan
 
PPTX
Stefaan Ponnet, Fusebox
nascomgenk
 
PDF
Spca2014 js link and display templates hatch
NCCOMMS
 
PDF
Microsoft Portals Deep Dive - Andrew Ly & Lachlan Wright
Andrew Ly
 
PPTX
Branding & Design Opportunities/Challenges with SharePoint 2013
Marius Constantinescu [MVP]
 
PPTX
Search
Gayathri Narayanan
 
PPT
Ajax workshop
WBUTTUTORIALS
 
PDF
Spca2014 search workshop niaulin
NCCOMMS
 
Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...
Chris O'Brien
 
GDG-USAR Tech winter break 2024 USAR.pdf
raiaryan174
 
Introduction to Content Search Web Part
Haaron Gonzalez
 
Approaches to mobile site development
Erik Mitchell
 
Developing Branding Solutions for 2013
Thomas Daly
 
Advanced guide to develop ajax applications using dojo
Fu Cheng
 
Introduction to AngularJS
Jussi Pohjolainen
 
Search overview
Hiep Luong
 
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Lucidworks
 
Content query web part – get it all in one place and style it!
Benjamin Niaulin
 
Developing Branding Solutions for 2013
Thomas Daly
 
Essentials for the SharePoint Power User - SharePoint Engage Raleigh 2017
Drew Madelung
 
BackboneJS Training - Giving Backbone to your applications
Joseph Khan
 
Stefaan Ponnet, Fusebox
nascomgenk
 
Spca2014 js link and display templates hatch
NCCOMMS
 
Microsoft Portals Deep Dive - Andrew Ly & Lachlan Wright
Andrew Ly
 
Branding & Design Opportunities/Challenges with SharePoint 2013
Marius Constantinescu [MVP]
 
Ajax workshop
WBUTTUTORIALS
 
Spca2014 search workshop niaulin
NCCOMMS
 
Ad

More from Chris O'Brien (20)

PPTX
Chris O'Brien - Building AI into Power Platform solutions
Chris O'Brien
 
PPTX
Chris OBrien - Azure DevOps for managing work
Chris O'Brien
 
PPTX
Chris O'Brien - Ignite 2019 announcements and selected roadmaps
Chris O'Brien
 
PPTX
COB ESPC18 - Rich PowerApps with offline support
Chris O'Brien
 
PPTX
COB - Azure Functions for Office 365 developers
Chris O'Brien
 
PPTX
COB - PowerApps - the good, the bad and the ugly - early 2018
Chris O'Brien
 
PPTX
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
Chris O'Brien
 
PPTX
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developers
Chris O'Brien
 
PPTX
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - reference
Chris O'Brien
 
PPTX
Chris O'Brien - Introduction to the SharePoint Framework for developers
Chris O'Brien
 
PPTX
Application Lifecycle Management for Office 365 development
Chris O'Brien
 
PPTX
Do's and don'ts for Office 365 development
Chris O'Brien
 
PPTX
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
Chris O'Brien
 
PPTX
Chris OBrien - Weaving Enterprise Solutions into Office Products
Chris O'Brien
 
PPTX
Chris O'Brien - Modern SharePoint development: techniques for moving code off...
Chris O'Brien
 
PPTX
Deep dive into SharePoint 2013 hosted apps - Chris OBrien
Chris O'Brien
 
PPTX
SP2013 for Developers - Chris O'Brien
Chris O'Brien
 
PPTX
Getting to grips with SharePoint 2013 apps - Chris O'Brien
Chris O'Brien
 
PPTX
SharePoint Ribbon Deep Dive
Chris O'Brien
 
PPTX
Automated Builds And UI Testing in SharePoint 2010 Development
Chris O'Brien
 
Chris O'Brien - Building AI into Power Platform solutions
Chris O'Brien
 
Chris OBrien - Azure DevOps for managing work
Chris O'Brien
 
Chris O'Brien - Ignite 2019 announcements and selected roadmaps
Chris O'Brien
 
COB ESPC18 - Rich PowerApps with offline support
Chris O'Brien
 
COB - Azure Functions for Office 365 developers
Chris O'Brien
 
COB - PowerApps - the good, the bad and the ugly - early 2018
Chris O'Brien
 
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
Chris O'Brien
 
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developers
Chris O'Brien
 
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - reference
Chris O'Brien
 
Chris O'Brien - Introduction to the SharePoint Framework for developers
Chris O'Brien
 
Application Lifecycle Management for Office 365 development
Chris O'Brien
 
Do's and don'ts for Office 365 development
Chris O'Brien
 
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
Chris O'Brien
 
Chris OBrien - Weaving Enterprise Solutions into Office Products
Chris O'Brien
 
Chris O'Brien - Modern SharePoint development: techniques for moving code off...
Chris O'Brien
 
Deep dive into SharePoint 2013 hosted apps - Chris OBrien
Chris O'Brien
 
SP2013 for Developers - Chris O'Brien
Chris O'Brien
 
Getting to grips with SharePoint 2013 apps - Chris O'Brien
Chris O'Brien
 
SharePoint Ribbon Deep Dive
Chris O'Brien
 
Automated Builds And UI Testing in SharePoint 2010 Development
Chris O'Brien
 

Recently uploaded (20)

PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 

Customizing the SharePoint 2013 user interface with JavaScript - Chris OBrien

  • 1. Customising the SharePoint 2013 UI with JavaScript P&M306 Chris O‟Brien - MVP
  • 2. About me  IndependentConsultant  Head of Development, Content and Code  Blog: www.sharepointnutsandbolts.com  Twitter: @ChrisO_Brien  LinkedIn: http://uk.linkedin.com/in/ chrisobrienmvp
  • 5. Terminology JSLink Client-Side Rendering (CSR) Display Templates
  • 6. Terminology • Lists • Fields • Web parts etc.. JSLink Client- Side Rendering (CSR) Display Templates • Content Search web part • Search hover panel • List callouts
  • 7. JSLink  Used to transform:  Lists  Views  Fields  Web Parts  Content types
  • 8. Registering templates/running code  The RenderContext JS object:  Templates collection – e.g. header, item, footer – Register with BaseViewID, ListTemplateType, ControlMode  OnPreRender  OnPostRender  ListData  ListSchema
  • 9. USING JSLINK TO FORMAT A LIST VIEW
  • 10. Demo screenshot: A SharePoint list transformed with JSLink (jQuery UI accordion)
  • 11. Demo screenshot: A SharePoint field transformed with JSLink (simple conditional formatting)
  • 12. Advanced CSR possibilities  Modify list data/schema in OnPreRender  E.g. lookup something dynamically  Use SPClientRenderer.Render() to obtain HTML:  From arbitrary data  Outside of page context  In AJAX methods
  • 13. Customizing the Content Search web part
  • 14. Content Query vs. Content Search Content Query web Content Search web part part Latency 100% up-to-date Depends on crawl frequency/speed Scope Current site collection Entire farm/tenancy Styling XSLT JavaScript Bonuses Parameterisation Support for slideshow, paging
  • 15. CSWP - 5 „easy to nail‟ requirements 1. “More like this” (Items matching a tag) 2. Recently changed items 3. Most popular items 4. “(Recent) items you may be interested in” (Matching current user‟s profile) 5. “Items related to you” (Contributor to document)
  • 16. CSWP options “Unique “Reusable instance” result set” • Configure • Use Result query in web Source (OOTB part properties or custom)
  • 17. The role of Managed Properties  CSWP has mappings to Managed Props for data:
  • 18. CSWP and Display Templates These items are files in ~sitecollection/_catalogs/master page/Display Templates/ Content Web Parts
  • 19. Diagnostic item template  Diagnostic template gives raw (ish) output  Tip: configure many props temporarily
  • 21. Demo screenshot: Content Search web part with default Display Template
  • 22. Demo screenshot: Content Search web part with custom Display Template
  • 23. Dynamic values in query Several tokens available: {User} {Page} {Site} • Match profile field • Match field value • Match current site e.g. e.g. Page.MyField e.g. Site.Url User.Department {Today} {Term} • Date filtering e.g. • Match current Today-7 managed nav term
  • 24. Script/CSS in display templates  Tools:  $includeScript  $includeLanguageScript  $includeCSS  Butconsider HTTP payload – may be better combining with other CSS/JS
  • 26. SP2013 search recap Result Source • Search scope on steroids Query Rule • Best Bet on steroids • E.g. Word doc, person, social Result Type post etc. Display • Visual rendering of an item Template
  • 27. Search display templates 1. Create the Display Template  Copy/rename then edit 2 files: Alternative - use – Item_Something.js [HTML] search results – Item_Something_HoverPanel.js [HTML] WP properties to 2. Create any core search config map to Display  E.g. Managed Properties, Result Source Template 3. Create the Result Type
  • 29. Hover Panel components - Item_CommonHoverPanel_Body.js - Item_[FileType]_HoverPanel.js
  • 30. Hover Panel actions  Footer actions can also be  Common  Specific  Gotcha! Some item types do not use Common actions  E.g. Discussion - Item_CommonHoverPanel_Actions.js - Item_[FileType]_HoverPanel.js
  • 32. Demo screenshot: Search hover panel customized for CAD files (i.e. custom behaviour for a specific content type)
  • 33. 2nd demo, screenshot 1: Adding a new action in the search hover panel footer:
  • 34. 2nd demo, screenshot 2: Clicking action fades in a textbox and button:
  • 35. 2nd demo, screenshot 3: Clicking „Post‟ button posts to user‟s social feed:
  • 36. 2nd demo, screenshot 4: Message in user‟s feed:
  • 37. Hover panel – lessons learnt  Can‟t use document.ready() – DOM is not populated  Specify function in ctx.OnPostRender instead  These functions are called ONCE (on first render [mouseover]) – N.B. Array of functions is accessible in all files e.g. header, body, actions etc.  DON‟T delete _#= ctx.RenderBody(ctx) =#_  This executes Item_CommonHoverPanel_Body.js (inheritance model)
  • 38. Summary  JavaScriptis key to many SP2013 UI elements  Examples shown:  Customising entire list UI  Conditional formatting of a field  Rendering of Content Search web part  Customising search hover panel (inc. AJAX)  Lots of other possibilities too!
  • 39. Thank you for attending! www.sharepointnutsandbolts.com @ChrisO_Brien