0

Is there a way to create a Web Part that would only show lists in SharePoint 365? I know how to add a web part that would show Document Libraries, etc., but I wonder if there a way to just show lists. The issue is that my site has a lot of Lists, Documents Libraries, etc, and when users go to Site Contents, it shows all of them, and I can't find a way to filter them by Type. Any hint would be appreciated.

  • yes, you can. Try it and let us know if/when you get stuck on something. – Derek Gusoff Nov 14 '19 at 0:30
2

It’s true that we cannot filter site contents in SharePoint Online.

The direct way to display all lists would be to create a site page and then manually add all list web parts on the page. This process can be automated with PowerShell.

You can also use Highlighted content web part. Add the web part on a Site Page and apply custom query under “Query text (KQL)”.

This is the query text I use:

(contentclass:STS_List) -contentclass:STS_ListItem_  Path:https://{siteURL}/Lists/ 

enter image description here

References:

Create Web Part in Modern SharePoint Online: PowerShell.

Use the Highlighted content web part.

SharePoint 2013 Keyword Query (KQL) Content Class Property Restrictions.

  • Brilliant. I haven't used the Highlighted Content Web Part option before, thanks for the suggestion. Just for curiosity, I wonder if would be better to just use REST instead (_api/web/lists). – cubanGuy Nov 14 '19 at 14:47
  • @cubanGuy I’m not familiar with Search REST but of course you can give it a try. – Chelsea_MSFT Nov 15 '19 at 1:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.