1

I have a SharePoint online instance, with wiki pages that hold information regarding content. What I need is to easily add web parts to those pages that show documents in a specific folder in a document library on the same SharePoint. Is this possible?

I've tried several things to no avail. Some links have suggested using a page viewer web part set to folder, but that doesn't seem to work for me (using the syntax "file://https:\company.sharepoint.com\Library\Folder". What am I doing wrong? I can set it as a web page not folder, but then I get duplicates of the left toolbar etc and I really just want to show the folder contents.

Please somebody must have done this before? It hardly seems like an edge case and it astonishes me that you can't just do it with an app part for the library.

I've even edited the CAML query to add the FileDirRef but I'm then getting no files in the folder.

  • Stop using folders, use metadata instead. Create a web page, put the web part there, and add a list view web part that is filtered to show the documents you want displayed. – wjervis Mar 9 '17 at 16:02
  • Believe me, I want to use metadata. But the users in my organisation want to use folders because that's what they know. – MrShoes Mar 10 '17 at 8:20
  • I think, for the CAML query to work, you have to set the scope of the <View> tag. – wjervis Mar 10 '17 at 11:49
0

You can add a content query webpart to the page. Then edit the properties select the list you want to display.

Then set the filter property URL path to target your specific folder.

  • This is a good start, but it doesn't behave like a library web part. For example, the first item is the folder itself, and the list doesn't show column information. Any way to style it? – MrShoes Mar 10 '17 at 11:38
0

The answer was this:

  1. Set the web part's View Scope="RecursiveAll"
  2. Set the view's query to contain <Where><Eq><FieldRef Name="FileDirRef"/><Value Type="Text">/subsite/library/Folder Name</Value></Eq></Where>

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.