There are different ways to search content on SharePoint classic sites like content search and content query webpart. But SharePoint modern sites have limited out of the box webparts. If we have a requirement to show documents, news or any other item from any site collection, we can use “Highlighted Content Webpart” which can get data based on different filters. In this article I will describe how to configure managed property based filter on highlighted content webpart for SharePoint modern site.
Let`s say we have a requirement to categorize all news within all site collections in your tenant in three categories,
- General News
- IT News
- Vertical News
Home page of the portal should have these sections to display all three kind of News from everywhere.
Step 1: Create Site Column
Go to all sites one by one and add site column “Site Type”.
Go to Settings - Site Information - View all site setting - Site Columns
Create new site column with the below details,
- Name – “SiteType”
- Type – Choice field
- Values – General , IT , Vertical
After adding Site column, “SiteType” should be there Under “Custom Columns”.
Step 2: Add Site column to Site pages
After site column is created, the next step is to add this site column to site pages library.
Go to Settings - Site Content - Site Pages library
Choose group “Custom columns” & columns “SiteType” - Add - Ok
Please make sure “SiteType” column is available on “Site Pages” library now.
Note
Step 1 & 2 needs to be performed with each site collection related to the portal.
Step 3: Add Highlighted content webpart
Edit home page or any page where you want to show all news, edit the page and add "highlighted content webpart" with the below configuration:
Set Managed Property -- > SiteType.
Note
Managed properties are generated automatically for site columns, if you don't see the name of your managed property in the highlighted content webpart, please verify managed property under "seach service application -->search schema"