搜索显示模板-它们是累积的 [英] Search Display templates - are they cumulative
问题描述
我似乎找不到答案. OOTB,是否每个商品都要通过模板"Item_default"然后在结果中定义一个(例如:excel映射到Excel Item)或仅通过"Excel Item" 模板.问题是我有两种内容类型:CT1和CT2.对于这两种内容类型,我都会在添加日期"中添加创建日期"在超链接下.我创建了Item_default的副本,将其命名为Item_default_MT,并添加了使用此模板的搜索结果 如果使用任一CT.现在,要求是改变身体"结构. (超链接上方的文本),但仅适用于CT2.因此,问题是我是否需要创建一个Item_default_MT2,其中包括Item_default_MT1中的更改和新信息. 然后将Item_default_MT1设置为CT1,将Item_default_MT2设置为CT2吗?
基本问题是:结果要先通过此模板,然后再通过该模板,还是只使用一个模板. (也不是在谈论Hoverpanel模板)
谢谢
SharePoint显示模板将呈现为控制模板+项目模板. /span>
根据您的要求,我认为您可以在自己的内容中添加内容类型ID自定义模板,根据内容类型id,显示不同的正文.
例如:
在属性映射中添加ContentTypeId.
< mso:ManagedPropertyMapping msdt:dt ="string"> ;'':',' Path':' Path',' ContentTypeId':' ContentTypeId',' PNumberOWSTEXT,':' PNumberOWSTEXT,' Description& ;#39;:',EditorOWSUSER':' EditorOWSUSER',LastModifiedTime':& ;#39; LastModifiedTime',' CollapsingStatus':' DocId':' DocId& #39;,' HitHighlightedSummary':' HitHighlightedProperties':' HitHighlightedProperties',' #39; FileExtension':' Filestension',' ViewsLifeTime':' ViewsLifeTime',# 39; ParentLink':' ParentLink',' FileType':' FileType',IsContainer' ;:' IsContainer',' SecondaryFileExtension':' DisplayAuthor':' ; DisplayAuthor'</mso:ManagedPropertyMapping>
检查显示模板中的内容类型ID. >
采样结果:
解决方案
Hi,
SharePoint display template will be render as Control Template +Item Template.
For your requirement, I think you could add content type id in your custom template, based on content type id, display the different body.
For example:
Add ContentTypeId in property mapping.
<mso:ManagedPropertyMapping msdt:dt="string">'Title':'Title','Path':'Path','ContentTypeId':'ContentTypeId','PNumberOWSTEXT,':,'PNumberOWSTEXT,','Description':'Description','EditorOWSUSER':'EditorOWSUSER','LastModifiedTime':'LastModifiedTime','CollapsingStatus':'CollapsingStatus','DocId':'DocId','HitHighlightedSummary':'HitHighlightedSummary','HitHighlightedProperties':'HitHighlightedProperties','FileExtension':'FileExtension','ViewsLifeTime':'ViewsLifeTime','ParentLink':'ParentLink','FileType':'FileType','IsContainer':'IsContainer','SecondaryFileExtension':'SecondaryFileExtension','DisplayAuthor':'DisplayAuthor'</mso:ManagedPropertyMapping>
Check content type id in display template.
Sample result:
Best Regards,
Lee
这篇关于搜索显示模板-它们是累积的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!