Custom hover panels

Table of Contents

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 Microsoft MVP working as the Head of Power Platform at Vantage 365. You can contact me using contact@sharepains.com

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.

Discover more from SharePains by Microsoft MVP Pieter Veenstra

Subscribe now to keep reading and get access to the full archive.

Continue reading