Quick Tip: Show Properties and Values of Items in Content Search Web Part

Sometimes it’s very helpful to know what fields you are pulling and what their values are when using a Content Search Web Part in SharePoint 2013.

Inside the unique comments that indicate javascript in a Display Template…

<!--#_    javascript code in here    _#-->

…add this

for(prop in ctx.CurrentItem) {
console.log(prop + "  " + ctx.CurrentItem[prop])

The values will be in the console of the browser you are in (F12 keyboard shortcut normally).

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

1 × one =