SharePoint 2013 introduces a new Community site template. To go along with it, there is also a Community Portal template for Site Collections. This portal essentially is a jumping off point into any and all communities that have been provisioned in your environment. The whole thing is powered by search but how exactly does it work? Specifically, how does the portal issue the search query and what exactly is SharePoint indexing for each community site? Let’s dig in.

First off, let’s take a look at this webpart and see what we can learn. A quick peek at the query tells us that the webpart is looking for the value ‘Community’ against a managed property of ‘WebTemplate’. Is the result item an actual SPWeb object? It would seem so. Let’s take a further look by dissecting the display template.

The display templates section of this webpart tells us that an external template is being referenced but it doesn’t tell us which one. So let’s export the webpart and dig deeper. What we learn is that there is a javascript file called Item_CommunityPortal.js in the masterpage gallery which is being used to display these result items. A scan of this display template indicates that metadata such as the number of members or topics is being extracted from the result item itself.

If our hypothesis is correct and the result item is in fact a SPWeb object then does this mean that these metadata values are being stored in the property bag for the web? One final validation reveals that this is in fact the case and voila! We now know how the portal knows what it knows about all the communities in the environment.

A few tangential but interesting items we pick up from the exported webpart are as follows-

  1. The fully qualified type name for the webpart (It’s not a content by search part)
  2. The fallback sorting algorithm

2 Responses to Inner workings of Community Portal in SharePoint 2013

  1. If you took a peek at SharePoint 2013 recently, you may have noticed there is a new Site Collection called the Community Site Portal. This new site works in conjunction with the Community Site template. In short, it’s a site that shows you a list of all Community Sites. My goal is to do the same thing but for other types of Sites, for example a Team Site portal.

  2. Reza says:

    Hi I have made a Community portal, but it keeps showing me “There are currently no communities in this view.”

    I asked about that in but there is no answer, can give me some guide lines about resolving this issue?

Leave a Reply

Your email address will not be published.

Set your Twitter account name in your settings to use the TwitterBar Section.