Highlighted Content Webpart

Learn how to show the content from a folder in the highlighted content webpart


The standard SharePoint webpart highlighted content can show specific files from your site, using standard filtering.

But what if you want to show files from another site.
To achieve this you can use the custom query and write

path:"https://tenant.sharepoint.com/sites/yoursitename/Shared Documents

Replace tenant and yoursitename, and if you are not using the standard document library, change the Shared Documents with the name of your library.

query1

If you have a sub-folder inside your documents library, we can see the folder now, but what if you would like to show the content of that folder (the files inside that folder)

The obvious thing to do would be to just add the full path to that folder

path:"https://tenant.sharepoint.com/sites/yoursitename/Shared Documents/Folder name

But the result we get will look like this

query2

We are only seeing the folders - not the content of the folders as your might expect.

The solution

We need to use a different type of query to get the value of what is inside the sub-folder

DocumentLink:"https://tenant.sharepoint.com/sites/yoursitename/Shared Documents/Test Folder/*"
AND FileType:*

The AND FileType:* is used to remove all items that is not a file type. You can leave it out if you want.

query3

Now you know how to show the content of your folders, using the highlighted content standard webpart


See also