I'm trying to make a relatively simple change to all search results (for a specific site collection), in order to display the content type of each result. I'm doing this with a change to Item_CommonItem_Body.html and I'm finding that while it works fine for some content types, it displays nothing on others, seemingly just the Office docs.
I've added SPContentType to the list of Managed Property Mappings:
...DisplayAuthor', 'SPContentType':'SPContentType'</mso:ManagedPropertyMapping>
And then I've added the following into the body of the html:
<div>Content Type: _#= ctx.CurrentItem.SPContentType =#_</div>
My test document set includes a number of different file types, each with a number of different content types, and while the text "Content Type: " shows up for all of them, the javascript variable SPContentType is coming through as an empty string for files which are office documents.
If I look at the files in question in their libraries, they have a couple of different content types set (some are "Document", some are custom content types we've created), but none will show their content type.
Has anyone else encountered this issue, or know how to resolve it?