I have an XsltListViewWebPart on a custom page that works fine for a SharePoint 2010 library. My problem is that I need to tell this web part to list only documents in a subFolder of the library. How is this done?
First, you have to set the scope of you View element.
FilesOnly will get you only the files within the selected folder. Default will get you the files of the selected folder and the subfolders.
Then to specify the folder, add a parameter in SelectParameters for the XsltListViewWebPart element.
<SelectParameters> <asp:Parameter Name="RootFolder" defaultValue="Documents/FolderName"/> </SelectParameters>