Debugging Display Templates in SharePoint 2013 Search

One may find difficult to extend existing Display Templates in SharePoint 2013 because of missing IntelliSense and type ahead suggestions of available members in ctx.* and ctx.CurrentItem.*

As a workaround you can use following trick using Google Chrome .

Firstly, modify one of display templates and put debugger; line.

Then upload it back and open target page, open Developer Tools (CTRL+SHIFT+I) and refresh. Your screen should look similar to the picture below, debugger will stop at your breakpoint.

Finally, switch to Console tab and take advantage of “IntelliSense” which will auto suggest you names of all available variables.

Execution of ctx.CurrentItem command will print you values of variables as well.debugger

6 Responses to Debugging Display Templates in SharePoint 2013 Search

  1. Pingback: Debugging the Display Template « Karine Bosch’s Blog

  2. Thanks, it feels like crawling but better then nothing. Hope Microsoft gives us a proper editor with intellisense soon.

  3. Johnk939 says:

    Sweet website, super layout, very clean and utilise genial. dffeadcgdddb

  4. Pingback: SharePoint 2013 – Debugging Display Templates | PursuitPoint

  5. comedy video says:

    This is the proper blog for anyone who desires to find out about this topic. You understand a lot its almost arduous to argue with you (not that I truly would need…HaHa). You definitely put a brand new spin on a topic thats been written about for years. Great stuff, simply nice!

  6. Lee says:

    Thank you, thank you, thank you! This saved my life! I was able to find the correct field I needed!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: