0

I'm trying to use the Content Search Web Part to show a listing of all the Site Collections within a web application. So I created a result source that set the path to the root of our web app, and set the contentclass to STS_Site.

It works for the most part, but I'm struck with 2 things I'm hoping to get help with.

  1. Is there a way to not have the results security trimmed, and show all the site collections, regardless of whether the user has access or not? Bonus would be to provide a user accessible option to select if they want the results to be trimmed.
  2. Most of our site collections don't have a Site Logo set. As a result, we get the ugly grey "?" image beside most of the results. How would I change the default logo/picture shown for sites that don't have a logo set?

2 Answers 2

0

1)The simple answer to your first question is that it is impossible. The reason is that Content Search is using Enterprise Search which is apply Security Trimming. So to achieve your requirements, you will need to create an application that runs with elevated privileges to return this information for you!

2) you have to create a custom display template, download the current display template you are using and rename the file and open it and give it another title (so you can differentiate from the other templates). Check for the line that put the image beside the site and create a small if statement to replace that if the value = the grey image.

here is a good source of how to work with display templates (if you have not worked with them before)

https://blogs.technet.microsoft.com/sharepoint_quick_reads/2013/08/01/sharepoint-2013-customize-display-template-for-content-by-search-web-part-cswp-part-1/

0

There are two ways to achieve #1 one is to maintain a separate "public" list of site collections and then use the results from that to drive the end user behavior you seek. The challenge is keeping the list current.

Another option, one that I have used successfully, is to keep the list of site attributes on each site collection. (We provision with PowerShell so creating the list and associated content type is simple.) Site Name, Loge, purpose, business impact, etc. are part of the content type. You can make that list public, keeping all of the remaining content private and drive user behavior that way.

2
  • Thanks Matt. Was hoping to avoid having to maintain a separate list, but I guess that's just not feasible.
    – Evan M.
    Commented May 10, 2016 at 14:44
  • Your security trimming requirement is the problem. Change that requirement and you can do it w/o a separate list. (Or grant everyone READ on all sites.) The list item approach I outline is very elegant. Commented May 10, 2016 at 19:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.