<p>I want to place a Webpart on a page that holds a subfolder of the Document Library in SharePoint, but somehow, the only thing I get is the root folder of the document library.</p>

<p>Is there a Webpart that fills this need?</p>

[{'answer_id': 82405, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 2, 'selected': True, 'text': "<p>By default I don't think that is possible.</p>\n\n<p>The list web part that would show the Shared Documents understands how to render the library, but doesn't understand how to filter to only show the contents of one subfolder.</p>\n\n<p>It would be nice to create a Filter Web Part and to provide that filter to the List web part so that it filters according to the sub folder defined within the fileref field of the document library. However the filters it appears to be able to consume are Type, Modified and Modified By. So you could filter it to just the documents you touched, but not the ones in a given location.</p>\n\n<p>End result: Roll your own web part.</p>\n"}, {'answer_id': 156049, 'author': 'Nat', 'author_id': 13813, 'author_profile': 'https://Stackoverflow.com/users/13813', 'pm_score': 1, 'selected': False, 'text': '<p>The reason is that the folder selected by the webpart is not controlled by the webpart itself, but by a querystring parameter.</p>\n\n<p>e.g.</p>\n\n<pre><code>"?RootFolder=%2fDocuments%2fMyFolder1&amp;FolderCTID="\n</code></pre>\n\n<p>So folders are not "real" folders as such, despite the "lie" that is the webdav interface\n e.g. <code>\\\\sharepointsite\\documents</code></p>\n\n<p>There should be a way of including the desired RootFolder parameter, like a linking to the page with the querystring included (far from ideal).</p>\n\n<p>I do not know of any webparts that do this.</p>\n'}, {'answer_id': 4696692, 'author': 'Denis M. Kitchen', 'author_id': 120638, 'author_profile': 'https://Stackoverflow.com/users/120638', 'pm_score': 0, 'selected': False, 'text': '<p>One alternative I\'ve used is to drop a Page Viewer Web Part on the page and choose "Folder" as the type of thing to view. Then specify the webdav UNC to the folder such as "\\some_sharepoint-site\\some_site\\shared documents\\some_folder\\"</p>\n'}, {'answer_id': 12008006, 'author': 'Derek', 'author_id': 1607210, 'author_profile': 'https://Stackoverflow.com/users/1607210', 'pm_score': 2, 'selected': False, 'text': '<p>Here is how to do it in Sharepoint 2010 with only Javascript, no SharePoint Designer necessary.</p>\n\n<ol>\n<li>create a document library web part on your web part page</li>\n<li>change the view to show all items without folders and set the item limit to a sufficiently large number so that there are no batches</li>\n<li>add Content Editor web part <em>below</em> document library web part</li>\n<li>Add the following javascript and change the the first variable to meet your needs</li>\n</ol>\n\n<p>Note: If you have more than one Document Library web part, you will need to add to this code.</p>\n\n<pre><code>&lt;script type="text/javascript" language="javascript"&gt;\n\n    //change this to meet your needs\n    var patt = /FOLDER%20TO%20SEARCH/gi; \n    var x = document.getElementsByTagName("TD"); // find all of the TDs\n    var i=0; \n\n    for (i=0;i&lt;x.length;i++)\n    {\n        if (x[i].className =="ms-vb-title") //find the TDs styled for documents\n        {\n            var y = x[i].getElementsByTagName("A");  //this gets the URL linked to the name field\n            //conveniently the URL is the first variable in the array. YMMV.\n            var title = y[0];  \n\n            //search for pattern\n            var result = patt.test(title);\n\n            //If the pattern isn\'t in that row, do not display the row\n            if ( !result )\n            {\n                x[i].parentNode.style.display = "none"; //and hide the row            \n            }\n        }\n    }   \n&lt;/script&gt; \n</code></pre>\n'}, {'answer_id': 18026927, 'author': 'Jennifer Kong', 'author_id': 2647484, 'author_profile': 'https://Stackoverflow.com/users/2647484', 'pm_score': 1, 'selected': False, 'text': '<p>I was able to do this by creating a new Column and specifying a keyword for the entire Shared Documents list. </p>\n\n<p>Then I had to add metadata.\nAdd the WebPart again to the page.\nCreate a View that enabled the display of the files as a flat list, and filter on the new Column (i.e. where Keyword is/contains ----).\nThen I get the list I want on the page with the web part.</p>\n'}, {'answer_id': 20639690, 'author': 'Asad Ali Sandhu', 'author_id': 3112066, 'author_profile': 'https://Stackoverflow.com/users/3112066', 'pm_score': 0, 'selected': False, 'text': '<p>Place the document library list view web part on any page.\nEdit the web part.\nFrom filter select column "Content Type" and value "Folder"\nSave and you are done. </p>\n\n<p>By doing that it will show you root folder files only.</p>\n'}, {'answer_id': 29227940, 'author': 'JohnDUSA', 'author_id': 3612746, 'author_profile': 'https://Stackoverflow.com/users/3612746', 'pm_score': 1, 'selected': False, 'text': "<p>I have a work around I've used that doesn't required Designer. Not as elegant, but achievable by any power user.</p>\n\n<p>After you've added the library web part, go to the page and click down to the folder you want to be the default.  See that the page link now shows something like : \n<code>www.mysite.com/sharepoint/default.aspx?RootFolder=%2Fsubfoldername&amp;FolderCTID=...</code></p>\n\n<p>Copy that link. Delete <code>&amp;FolderCTID</code> and everything that follows. In this case what remains is :<br>\n<code>www.mysite.com/sharepoint/default.aspx?RootFolder=%2Fsubfoldername</code></p>\n\n<p>Use this link for navigation to the page and the library will display as you want within that page. Be aware it does not replace the default view for that page.</p>\n"}, {'answer_id': 47141636, 'author': 'Alberto S.', 'author_id': 1538604, 'author_profile': 'https://Stackoverflow.com/users/1538604', 'pm_score': 1, 'selected': False, 'text': '<p>Another way of face this issue would be to just use the Content Search WebPart ( CSWP ) and filter the results based on : </p>\n\n<ul>\n<li>folder path</li>\n<li>url depth</li>\n</ul>\n\n<p>You will need a UrlDepth value that matches your requirement. The best thing is to use a high value, like 10, and then reduce until it shows just the files you need.\nRegarding folder path, remove the (quotes) ", this way the query will perform a "contains" lookup, instead of "equal to":</p>\n\n<p>Result will be something like this:</p>\n\n<pre><code>path:[your site]/Docs/our_team  UrlDepth:7 \n</code></pre>\n\n<p>If the <strong>folder name contains spaces</strong>, you may need to wraps it with quotes. something like:</p>\n\n<pre><code>path:[your site]/Docs/"our team"\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/82286', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/15637/']