Posts

Showing posts with the label Content search

Display Template Deployment in SharePoint 2013

Hi Guys, New way to transform search result introduces in SharePoint 2013 which provide a good user experience through the use of display templates. It is far better then using XSLT in SharePoint 2010 to use to customize that display. It is really frustrating while understanding XSLT display templates. The great thing about display templates is that you create them by leveraging skills that many developers already possess: HTML and JavaScript. The most likely approach to creating display templates is to start with an existing display template HTML file and customize it. It’s not too difficult when you get the hang of the _#= (underscore pound equals) syntax. It’s very important to understand what happens when you edit that HTML file. When you click save SharePoint creates a JavaScript file and associates the two together. (The same thing happens when creating master pages using the design manager but HTML to MASTER file). When you select your display template in the content by search w...

Get Comment Count in SharePoint

Hi Guys, In this blog I will explain how we can get the number of comments on any page/article. Prerequisites for this blog are: a list with rating enabled, an article/page/splistItem already have got comments from users and a tool like VS to code ;) According to requirement it may be the case that one need to get item comment count using java script or c#. I will explain both way to get the comment count: Using Javascript: This may be the case when one want to use the content search webpart or CQWP to display comment count. Followng code can be use to get the comment Count: var linkURL = $getItemValue(ctx, "Link URL"); linkURL.overrideValueRenderer($urlHtmlEncode); // Get the Comments count var soapEnv = "<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'> \ <soap:Body>    \ <CountCommentsOnUrl xmlns='http://mi...