SharePoint 2013 – Hover Panel Display Templates not showing Custom Columns

My Problem

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.

 

 

Advertisements

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

Please leave a comment or feedback

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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