Custom hover panels

Today I created a custom hover panel. I took the default item_Default_HoverPanel.html from my Display Templates Gallery and added a copy as item_custom_hoverpanel to the Display Template Gallery.

I also did the same for item_default.html as there is a reference to the hover panel used in there.

The I added some extra fields to the following line:

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

But whatever I did my properties would not appear. In the above line I added the propery:

<mso:ManagedPropertyMapping msdt:dt=string">'MyCustomManagedProperty':'MyCustomManagedProperty','Title':'Title,.... </mso:ManagedPropertyMapping>

I created a Managed property and checked the properties many times. I ran a full search crawl , still no luck.

I even added the property to a Refinement panel aha it appears in the refinement panel. So this is the proof that the managed property works.

 

Your solution

I added the same custom property to my item_custom.html

<mso:ManagedPropertyMapping msdt:dt=string">'MyCustomManagedProperty':'MyCustomManagedProperty','Title':'Title,.... </mso:ManagedPropertyMapping>

And now my hover panel suddenly shows my properties. Why??

The item_custom/item_default.html builds up the ctx object and this is not updated by hover panels. Therefore cts.CurrentItem isn’t changed when my hover panel uses additional Managed properties.

 

 

Avatar for Pieter Veenstra

By Pieter Veenstra

Business Applications and Office Apps & Services Microsoft MVP working as a Microsoft Productivity Principal Consultant at HybrIT Services. You can contact me using contact@veenstra.me.uk.

One thought on “SharePoint 2013 – Hover Panel Display Templates not showing Custom Columns”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: