In this post I will explain how to use the Content Query web part to display SharePoint blog posts on a SharePoint Online intranet site.
We will explore three ways this feature can be built to display all blog posts, including filtering of the results in the Content Query web part.
1. Displaying all Blog Posts
Firstly we will add the web part and configure it to show all blogs.
Edit the page and in the ribbon under the ‘insert tab’, select ‘Web Part’; then select the ‘Content Rollup’ category and then select the ‘Content Query Web Part’, click ‘Add’.
Next, ‘Edit the Web Part’.
In the Query section, under ‘List type’, select ‘Posts’ from the drop down underneath, ‘Show items from this list type:’
In the ‘Appearance’ section, change the ‘Title’ to ‘Our Blogs’.
In the ‘Presentation’ section, set the item limit to 10, and make sure the ‘Fields to display’ link field is left blank. Save the Web Part and the page.
The Web Part will now display all blogs.
2. Displaying Featured Blogs
In order to display only ‘Featured blogs’ through the ‘Content Query’ web part, we first need to add an additional column to our ‘Posts list’ on our blog site.
To do this, navigate to your blog homepage and click ‘Manage Posts’.
Click ‘List Settings’ under the list tab in the ribbon.
Click ‘Create column’ under the columns heading.
Call the column “Feature Blog?” and select column type ‘Yes/No’ (check box). In the description box you might want to enter a prompt for the user, e.g. “Would you like this blog to be featured?” Featured blogs are displayed to users on the intranet homepage. It is also worth setting the ‘Default value’ to ‘No’.
Now edit some of the blogs and tick the box to make them a ‘Feature Blog’.
Navigate back to the page containing your Content Query web part and ‘edit’ the web part.
In ‘the appearance’ section, change the name to ‘Featured Blogs’.
In the ‘Query’ section, under ‘Additional Filters’ heading, set up the filter as follows:
Show items when: Featured Blog?…is equal to…Yes
Click ‘OK’ and save the page. Your web part will now only display those blogs that your content authors specify as ‘featured’.
3. Displaying Popular Blogs
Next, we will configure the web part to only show ‘Popular blogs’ e.g. blogs that have a user rating of 4 or more stars out of 5 (on average).
In order to display only ‘Popular blogs’ through our Content Query web part, we first need to change the ‘Rating Settings’ on our blog site.
To do this, navigate to your blog homepage and click ‘manage post’ as before, on the ‘Posts List’ open the ribbon and click ‘List Settings’.
Click ‘Rating settings’ under the ‘General Settings’ heading.
Change the voting/rating experience for this list from ‘Likes’ to ‘Star Ratings’.
Rate some of the blogs by clicking on the stars.
Now navigate back to the page containing your Content Query web part and edit the Web Part.
In the ‘Appearance’ section, change the name to ‘Our Top Rated Blogs’.
In the Query section under the ‘Additional Filters’ heading, set up the filter as follows:
Show items when: Rating (0-5)…is greater than or equal to…4
Click OK and save the page. Your web part will now only display those blogs that have an average user rating of 4 or more stars out of 5.
This should now all be set up, we hope you found this page useful.