I've list of community sites in a site collection, and I have a publishing page on my site collection with a content editor WebPart on it. I've to show list of joined community sites on this webpart and I've a button "show more" at the bottom of the webpart, when i click on it I've to show a search result webpart which shows all joined community sites under current site collection. I'm trying use REST / CSOM on this content editor webpart. but i didn't find any way to do this. any ideas?

  • What are "joined sites"? Why the need for a content editor, a Search or Query web part would be a better choice. Nov 22, 2013 at 14:50
  • joined sites are the sites in which I clicked "Join this community" button on community site home page (member of the community). Even if I use search web part it is returning all community sites even if I'm not that community member. Is there any managed property to filter joined community sites. Nov 22, 2013 at 17:58

1 Answer 1


OK, I think I understand. There are a couple approaches you could take. Members of a Community Site are stored in the Members list. You can query the list with a KQL query like "ContentClass:STS_ListItem_880 {User.Name}" or "MemberOWSUSER:{User.Name}" this will return the Members list items from the sites. You could then trim the returned URLs to determine the associated sites. You might even be able to sort the return by the points you have on the site. That would be cool.

you could implement a result source of community sites or members to assist in narrowing your focus. It would add an interesting dimension to the query depending on what you are trying to accomplish.

You could add this query to a Search Web Part and apply a custom Display Template to render the Sites in a better presentation than the default item.

BTW, the default community sites search returns the sites you have access to, even if you are not a member because that is how search works in SharePoint. If you apply security to the sites it will prevent this from happening. The query is simply looking for the Community Site template.

  • Thank you very much for this. I'll try it. How can I sort the return by the points I have on the site? Sorting is also part of my requirement. Thanks. :-) Nov 25, 2013 at 16:42
  • Add the Sort attribute to the managed property. Nov 26, 2013 at 13:34
  • to which managed property. MemberOWSUSER? Nov 26, 2013 at 13:39
  • I'm already using "ContentClass:STS_Web" to get only sites in results. Do I need to remove this and add "ContentClass:STS_ListItem_880 {User.Name}" and trim the URL. I used "{searchboxquery} contentclass:STS_Web AND Path:{Site.URL}* WebTemplate=Community AND People:{User.Name}" to get results Nov 26, 2013 at 13:41
  • I would expect that you do. I only did a quick test. In my case I found it easiest to search for the Member records per your requirement. I would expect that ContentClass:STS_Web and ContentClass:STS_ListItem_880 would be mutually exclusive. Nov 26, 2013 at 13:45

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.