MOSS 2007 使用内容查询 Web 部件显示文件夹的内容
我正在尝试使用内容查询 Web 部件显示某个文件夹的内容。虽然我完全能够显示文档库(文件夹的父级)中的所有文件或仅显示文件夹,但我无法理解如何显示特定文件夹的内容。谁能启发我吗?
I'm trying to display a certain folder's content using the Content Query Webpart. While I'm perfectly able to display either all files in the document library (parent of the folder) or just the folder(s), I fail to understand how you would display a certain folder's content. Can anyone please enlighten me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我也遇到过同样的问题,而且相当令人沮丧。似乎没有一种简单的方法来查询文件夹路径。如果您在查询位置中输入完整的文件夹路径,它不会为您提供所需的内容,并且通常会默认为整个站点。因此,我找到了两种可能的方法来实现您可能正在寻找的内容,具体取决于您的其他要求:
1)不使用文件夹,而是使用单独的文档库。如果您的“文件夹”数量有限,这可能会起作用,但站点可能很快就会变得难以管理 50 多个文档库。
2) 将自定义列添加到您的文档库,该列可以识别您要查找的位置中的文档。就我而言,我只有一个需要从主页查询的文件夹,因此我添加了一个名为“主页链接”的是/否(布尔)自定义列。对于特定文件夹中的所有文档,我将主页链接值设置为“是”。如果您的解决方案需要查询多个文件夹,您可能会考虑添加一个名为“Folder”的自定义列,这将要求您输入文件夹名称或整个文件夹路径作为每个文档的属性值。这可能很快就会变得难以管理和维护,但它确实提供了一个可以查询的属性。设置属性后,将其作为过滤器添加到视图或内容查询 Web 部件中,您将获得仅具有该属性值的特定文件的查询。如果您使用视图,请选择“显示不带文件夹的所有项目”选项以获得正确的输出。
我希望这有帮助。也许SP 2010会对此进行一些改进。
I've had this same problem, and it's rather frustrating. There doesn't appear to be an easy way to query on the folder path. If you enter the full folder path into the query location, it doesn't get you what you want and often defaults to the whole site. So, I've found two possible ways to achieve what you may be looking for, depending on your other requirements:
1) Instead of using folders, use separate Document Libraries. This may work if you have a limited number of "folders", but the site may quickly become difficult to manage with 50+ Document Libraries.
2) Add a custom column to your Document Library that can identify documents in the location that you're looking for. In my case, I only had one folder that I needed queried from the home page, so I added a Yes/No (Boolean) custom column named "Home Page Link". For all of the documents in the specific folder, I set the Home Page Link value to "Yes". If your solution requires querying more than one folder, you might think about adding a custom column named "Folder", which would then require you to enter the folder name or entire folder path as the attribute value for each document. This could quickly get difficult to manage and maintain, but it does provide an attribute which you can query on. Once you have the attribute set up, add it as a filter to your view or your Content Query WebPart and you'll get a query of just the specific files with that attribute value. If you use a View, select the "Show all items without folders" option to get the right output.
I hope that helps. Maybe SP 2010 will have some improvements on this.