4

I'm trying to access the metadata Tags of a SharePoint page within the search result of that page using a Display Template. In the Managed Properties for my search service, the Tags property is available, searchable, queryable, etc. and I've done a full crawl to ensure this property is pulled into the index.

Within the Item_CommonItem_Body.html Display Template, I have 'Tags' property listing within the ManagedPropertyMapping as shown below:

<mso:ManagedPropertyMapping msdt:dt="string">'Title':'Title','Path':'Path','Tags':'Tags',...

Lastly, I'm attempting to display the Tags within the body of the display template using the following:

_#= $htmlEncode(ctx.CurrentItem.Tags) =#_

Using the code htmlEncode code snip above, I'm able to display other aspects of the page such as the Author but I can't seem to get the Tags to display. I've also broke down the ctx.CurrentItem using the IE JavaScript debugger and couldn't find the Tags within the object anywhere. If someone has experienced this before, any help would be much appreciated. Thanks!

1
  • 1
    Why don't you use refiners and a enterprise search center? Commented May 24, 2013 at 12:46

1 Answer 1

1

In SharePoint 2013 the tags are wrapped up in Social. They are probably accessible through the SocialActor class.

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.social.socialactor.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1

Though I am not sure how to change your code to make them available. Hopefully this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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