Dec 01

Show content of a specific folder in a LVWP

Quick post about a request that came in this morning. A user is showing the contents of a doc library on a page, but only wants the contents of a specific folder to appear. By default the list shows all contents of the doc library. Modifying the view through the browser will not allow you to speficy a folder. What we need to do is create a filtered view through SP Designer. Here’show that’s done:

 

  • From the library, click the view drop-down menu and choose Create View

 

  • Select the option to crate a custom view in SPD

  • SharePoint Designer will open, then ask you to give your new view a name. Once that’s done, click on the link to edit the view

  • Once the page editor opens, select your LVWP on the page, then go to the Folder scope drop-down list on the ribbon to select “Show All Files of All Folders”

  • You’ll notice the contents of the web part change to show all folders in the doc library. Now we need to filter the items. Select the filter option from the left side of the ribbon and the following window will appear. Choose “Path” from the first drop down, and enter the Value in this format:  /SiteCollection/Site/SubSite/Library/Folder

  • If all goes well you should see the contents of your folder appear in the LVWP. When I first looked into doing this, the blog posts/threads didnt mention the syntax for doing this on a subite, so it took some trial and error before I got the filter value correct.

If you don’t want to read all of the above, this YouTube video is a great walkthrough of the same process :)