In many organizations, people rely on the corporate news provided by various teams in the company. Also, they might spend a lot of time with finding and accessing the news that are relevant for them.
By default, Office 365 provides a couple of options to close this gap and help the users stay up-to-date. In this post, I’m sharing a few options how to turn your intranet to a real news portal, beyond creating the news posts and letting them get lost in the content silo.
News posts in SharePoint Online are stored as pages in the Site Pages library.
In Microsoft Search, there’s a separate vertical for News – however, there might be cases when we need more, e.g. a custom vertical, or a web part filtering for News items.
Let’s see what features and options we can rely on.
Out-of-the-Box Options to display News
News Vertical in Microsoft Search
The most obvious option we have is the News vertical in Microsoft Search: it displays all the News posts from the corresponding search scope.
News web part
News web part can be added to any modern SharePoint page to display news items. With the help of this web part, we can filter for news from the following scopes:
- This site
- Selected sites
- Recommended for current user
While this web part provides an easy way to display News items to the users, its options to select what to display is very limited.
Highlighted Content Web part
The Highlihted Content web part is a more powerful tool: when selecting “News” as type of content, it will display the news posts from the selected source matching the filter criterias.
The filtering options are more advanced here than in the “News” web part. We can select “all sites” or selected sites as well as “This Hub” as the data source. Also, we can add filters by various properties, e.g. title, or any Managed Property in the search schema.
Moreover, if these user friendly filtering options are not enough, we can also use KQL queries with all of its power.
PnP Modern Search Results web part
There might be business requirements when the Highlighted Content Web Part is not enough: for example, when we need more advanced formatting, even further filtering, or we want to connect it to a search box web part.
In these cases, what we might need is a custom search experience – for example, with the help of PnP Modern Search library, or a custom search web part library.
However, with these search web parts, we’re adding one more challenge: we need to know which Managed Property to use for filtering (same is true for the Highlighted Content Web Part, if we want to use it KQL mode).
The first idea: Content Types
The first thing that naturally comes to our minds is that what we might need is the Content Type of news posts. However, when we navigate to the Site Pages library, what we can see is that “Site Page” Content Type is used for all, there is no specific one for news:
The big question: which metadata to use?
As you might guess, this blog post would not be born if this would be the end of the story.
If using Content Type is not a viable option any longer, the next step is to check what other properties we have set on the news pages, which can be used to identify what is a news item, and what’s not.
The good news is, there is a property called “Promoted State” which can be used for this purpose. This is a column on the Site Pages library, with the following values:
- 0 – a published ‘site page’ that is NOT considered ‘News’ and does not end up in the news roll ups;
- 1 – a news page that is not published yet;
- 2 – a published news page or a news link.
News in Search: The PromotedState Managed Property
Now that we know the column name to be used, it’s easy to find the corresponding Managed Property in the search schema: its name is PromotedState, and it’s a number (integer).
Now, if we need to filter for news items in search, or in any search-driven business application, the only thing we have to add to the query is:
This ensures that only news items will be returned. Of course, we can also add additional filters to the query as needed – but the PromotedState is a must when filtering for SharePoint news items.
We have seen how the News Web Part, Highlighted Content Web Part and PnP Modern Search Results web parts can be used to display news items. We have also seen that the Content Type of news cannot be used for filtering, but luckily, a Managed Property called PromotedState can be used for this purpose – providing us with an important and reliable filtering option.