문제

I have a content search web part that returns site collections. I don't want the search to show the site icon. The box that shows the site icon

I can't hide the div because each item has a unique class. Is this possible? I can't find any answer on this anywhere.

도움이 되었습니까?

해결책 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.

custom display template

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.

enter image description here

다른 팁

Alternatively you can change Item template of content search webpart. Edit the webpart and set item template under display template as "Two lines" which will not display any images.

enter image description here

OutPut:

enter image description here

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top