Sharepoint - Show only a subfolder of a document library in a web part

What I ended up doing was creating a view on the document library and applying the query/scope changes mentioned above to the <View> definition in the new document library's view. The case sensitivity spevilgenius mentioned matters, but even with that correction, I couldn't get the view to work in the aspx page's web part.

The weird thing is that it appears that when you apply a view to a web part list/document library viewer, it looks like Sharepoint copies that view's definition to the web part's definition. And, indeed, if I look at the code of my page now, I see the exact view definition code there as well as my view. It might work if you put the code below directly in the aspx page and skip the step where I created the view on the Document Library. I've been beating my head against this wall since last night, though. Don't feel like trying anymore permutations...

<View Name="{GUID}" Type="HTML" Scope="RecursiveAll" DisplayName="DisplayName" Url="Url-To-View" Level="1" BaseViewID="1" ContentTypeID="0x" ImageUrl="/_layouts/images/dlicon.png">
    <Query>
        <Where>
            <Contains>
                <FieldRef Name="FileDirRef"/>
                <Value Type="Text">FolderIWantToShow</Value>
            </Contains>
        </Where>
    </Query>
    <ViewFields>
        <FieldRef Name="DocIcon"/>
        <FieldRef Name="LinkFilename"/>
    </ViewFields>
    <RowLimit Paged="TRUE">30</RowLimit>
    <Toolbar Type="Standard"/>
</View>

Have you considered simply using a Page Viewer Web Part that points to your folder?

Also, I assume you have good reasons to use folders, but your question is typically the reason why people recommend using metadata rather than folders.


Unfortunately Sharepoint 2010 Foundation does not allow for permission based metadata which makes restricting which of your users can upload and where they can upload a tad difficult; unless, of course, folders and folder based permissions are implemented.

Tags:

List View