SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Sharepoint 2013 search display template working nicely. I wanted to add a new managed property mapping to the template which is of type "hyperlink or picture". This content type stores both a URL and description. It returns a comma separated value of link and description (ie., my description). Not sure how to grab the link and description individually using $getItemValue from within the template?

Any pointers or examples would be much appreciated!

share|improve this question

From within the template you could get the value then split it using a JavaScript function e.g.

var commaSeparatedLinkAndDescription = ctx.CurrentItem.MyCustomProperty;

     var array = commaSeparatedLinkAndDescription.split(','); 

Then assign the first and second array elements to variables for the URL and description.

var URL = array[0];
var Description = array[1];

Hope this helps!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.