Hide a site icon from the search results
-
30-12-2020 - |
La solution 2
Thanks to all that commented and answered! It pushed me in the right direction!
What most were suggesting was to use another display template or to create a custom display template. So that's what I did.
This is a copy from the original display template I was using, "Site Item" (or Item_Site.html) In the copy, that I renamed "Item_Site_noLogo.html", I went in and poked around until this change to the code gave me what I wanted:
/*if(!$isNull(ctx.CurrentItem.SiteLogo) && !Srch.U.isDefaultSiteLogo(ctx.CurrentItem.SiteLogo)){
ctx.CurrentItem.csr_PathLength = Srch.U.pathTruncationLengthWithPreview;
ctx.CurrentItem.csr_PreviewImage = ctx.CurrentItem.SiteLogo;
ctx.CurrentItem.csr_PreviewImageAltText = Srch.Res.hp_Alt_SiteLogo;
} else {
deepLinksClassNoEncode += " ms-srch-item-deepLinks-noPreview";
}
*/
deepLinksClassNoEncode += " ms-srch-item-deepLinks-noPreview";
I just commented out the section that grabs the site icon and so any result won't show a preview.
Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange