質問

We have a BCS-model which gets data from a database outside of SharePoint. We make data from the BCS searchable by creating managed properties and then mapping them to the auto generated crawled properties from the BCS model.

I am developing a custom display template where I want to show that data from BCS. I can show some of the managed properties by accessing "ctx.CurrentItem", but not all of them. I.e I have a managed property called "CaseDate" which is not available on "ctx.CurrentItem". I can retrieve "CaseDate" by using rest API, but cannot find a way to access/show it in my display template.

Is there a way I can get a spesific managed property in my display template? How can I get the "CaseDate" in my display template ?

Edit: There is no error in crawl, and I have also tried "CaseDate" as managed property in ManagedProertyMapping in the display template.

役に立ちましたか?

解決 3

I was editing standard search results web part. The reason why my mapped properties where not showing was because I only added the mapped property in the display template that shows the hover panel (Item_Commonhoverpanel_Body). I had to add the managed properties in the Item_Default also, or else it would not show them in the hover panel.

Of course I created my own display templates, and did not destroy the ones that ship with SharePoint.

This link helped me a lot:

When adding custom properties to a hover panel, you have to add them to the item display template

https://blogs.technet.microsoft.com/tothesharepoint/2013/09/12/how-to-display-values-from-custom-managed-properties-in-the-hover-panel-in-sharepoint-server-2013/

他のヒント

Are you sure that you have included that managed property in the listing at the top of the item template? What does the Sharepoint search query tool show?

After you created the Result Type Rule for your Display Template, did you go back to the Result Type Rule page? Sometimes there will be a yellow message saying your properties need to be updated. Click the affirmative action (the message should turn green) and try again.

ライセンス: CC-BY-SA帰属
所属していません sharepoint.stackexchange
scroll top