Sharepoint: How do I filter a document library vie

2019-02-08 13:07发布

A number of business areas I work with use a folder structure to organise their Sharepoint housed documents (not ideal I know, but we're stuck with it).

I would like to use a web part page to present a number of views of their document libraries based on the subfolders that the documents appear in, but this is proving more difficult than I had thought. Has anyone overcome this problem in the past?

9条回答
贪生不怕死
2楼-- · 2019-02-08 13:56

Have you thought about creating a view with 'Folder = Show all items without folders', that would get all your documents out of their folders and then perhaps you could create your filter(s) over that view.

查看更多
别忘想泡老子
3楼-- · 2019-02-08 13:57

In SP2013 Online, I tried the filter conditions as Name Contains Folder_I_want_to_list

This showed me all the folders containing the Name in their file path. It lists even sub-folder contents which wasn't available when i tried Name equal to Folder_I_want_to_list

查看更多
欢心
4楼-- · 2019-02-08 13:59

I don't know of any out-of-the-box way to achieve this. As you say, this is not how SharePoint lists are intended used. It might work to create a custom site column displaying the path to the document, as this might be used in a filter. Have never tried it, though.

查看更多
萌系小妹纸
5楼-- · 2019-02-08 14:00

Have a look at the content by type web part - http://codeplex.com/eoffice - probably the most flexible viewing web part.

查看更多
一夜七次
6楼-- · 2019-02-08 14:08

With Sharepoint Designer you can edit the CAML of your XSLT List View.

If you set the Scope attribute of the View element to Recursive or RecursiveAll, which returns all Files and Folders, you can filter the documents by FileDirRef:

<Where>
   <Contains>
      <FieldRef Name='FileDirRef' />
      <Value Type='Lookup'>MyFolder</Value>
   </Contains>
</Where>

This returns all documents which contain the string 'MyFolder' in their path.

I found infos about this on http://platinumdogs.wordpress.com/2009/07/21/querying-document-libraries-or-pulling-teeth-with-caml/ and useful information abouts fields at http://blog.thekid.me.uk/archive/2007/03/21/wss-field-display-amp-internal-names-for-lists-amp-document-libraries.aspx

查看更多
Evening l夕情丶
7楼-- · 2019-02-08 14:10

Try this, pick or create one column and make that value required so that it's always populated such as title. A field that doesn't hold the name of the folder. Then in your filter put the filter you wanted that will select only the files you want. Then add an or to your filter, select your "required" field then set it equal to and leave the filter blank. Since all folders will have a blank in this required field your folders will show up with your files.

查看更多
登录 后发表回答