We are actually building a Social network based on Sharepoint 2013 for a Huge Airways company.
One need was to be able to associate communities together in order to ease the navigation between communities.
To do so, we have used the super powerfull search engine!!
Step 1 : Create a new Display template
One need was to be able to associate communities together in order to ease the navigation between communities.
To do so, we have used the super powerfull search engine!!
Step 1 : Create a new Display template
- on your Site collection go to the masterpage catalog (_catalogs/masterpage/Display Templates/Search) and copy the Item_Community.html file.
- Modify it (For our needs I wanted to display the sitelogo, and change some display). QUite easy to do. It's only manipulating JS and HTML.
- Post your newly renamed HTML in the same folder and it will automatically create the associated js.
- I have added a new property "AssociatedCommunities" on the community using a simple aspx page. The code is simply :
- Web.AllProperties["AssociatedCommunities"] = "URLCOmmunity1;URLCOmmunity2;URLCommunity3;"
- Do a full crawl on your content source to make your property available for your search service.
- In the search service, create a new managed metadata that you will Set as Searchable and Queriable, and then map it on your propertybag property.
- Set the following query :
- WebTemplate:Community AssociatedCommunities:{SiteCollection.URL}
- In the "Display template" section put "Use a single template to display items" and set your display template
- I personnaly removed all the options (but the "ranked results" one).
No comments:
Post a Comment