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

Advertisements

4 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

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: