CSWP Simple Discussion Posts

Using the Content Search Web part and a CSS file you can create a simple Discussion board list that pulls discussion board posts from multiple sites or discussion boards.

Creating Simple Discussions CSWP listing

1. Download and extract the css and announcement icon from the zip file:

2. Add the css file and icon to the Site Assets library on the site.

2. Edit a Site Page and Insert a Content Rollup > Content Search Web Part onto the page.

3. Edit the web part.

4. Click on the Change query option.

5. Click on the Switch to Advanced Mode option.

6. Edit the Query text, your Query text should include the path to 2 or more sites or discussion lists enclosed in brackets and separated by OR statements:
(path:”https://hostname/sites/sitename/” OR path:”https://hostname/sites/testsite/lists/discussionboard”)

Then also include: SPContentType=Discussion

7. Click on the Sorting tab, and sort by Created Descending:

8. Select the number of discussions to show and select the Picture on left, 3 lines on right Item display template.

9. Expand the Property Mappings section, check the Change the mapping of managed properties, for Line 2 select the Created property.  Click OK to save your web part.

10.  Add a Media and Content > Script Editor web part to the page.

11.  Edit the Script Editor web part

12. Click the Edit Snippet option, enter a link reference to the css file in the Site Assets library in the Script Editor. The format of the link reference is included in the screenshot below, you can either use the full path to the file or ../SiteAssets/filename.

Click the Insert button to save the Script Editor.

You should now have a simple discussions web part which pulls discussion board posts from multiple lists and displays them ordered by the most recently created ones first:

About Nick Hurst (85 Articles)
SharePoint and Nintex developer who strives to find easy to deploy and maintain solutions for business problems.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: