List Document Libraries and Documents

SharePoint sites often contain multiple libraries, with each including dozens or even hundreds of documents. This example will detail how to create a Web Part that displays a list of the most recently modified document libraries/documents, along with how to simply view a quick list of all libraries.

  • Step 1: Ensure the RSSBus Web Part is installed.
  • Step 2: Make sure you have access to a few document libraries with documents inside.
  • Step 3: Add the RSSBus Web Part to your page and paste the following template into its source editor. Click "Apply" in the template editor and the template will go into effect, giving you a list of recently modified libraries and documents.
<rsb:info>
   <input name="maxlibraries" default="5" />
   <input name="maxdocuments" default="5" />
</rsb:info>

<rsb:call op="spListLists?listtype=DocumentLibrary" save="lists" /> 
  <table width="100%"> 
  <rsb:call op="feedSort?type=date&sort=-sp:item_modified&feed=[_feeds.lists | urlencode]" pagesize="[maxlibraries]" >
    <tr>
      <th style="background-color:LightGrey; white-space:nowrap" colspan="2"> 
        <a href="[sp:url]">[rss:title]</a> 
      </th>  
    </tr> 
  <rsb:call op="spListDocuments?library=[rss:title]" save="mydocs" /> 
  <rsb:call op="feedSort?type=date&sort=-sp:modified&feed=[_feeds.mydocs | urlencode]" pagesize="[maxdocuments]" > 
    <tr> 
      <td><a href="[sp:url]">[rss:title]</a></td>  
      <td> 
        <rsb:set attr="today" value="[sp:modified | todate('MM/dd/yy')]" /> 
        <rsb:equals attr="today" value="[null | date('MM/dd/yy')]"> 
          [sp:modified | todate('hh:mm:ss')] 
        <rsb:else> 
          [sp:modified | todate('MM/dd/yy')] 
        </rsb:else> 
        </rsb:equals> 
      </td> 
    </tr> 
  </rsb:call> 
</rsb:call> 
</table>

This template lists all of your document libraries and sorts them by the last modified date. Also, for each libraries, it lists the documents within and sorts by the last modified dates. The result is a view of the most recently modified documents on the site.

After you paste this template into the source editor, click 'Apply'. You can customize the HTML in the template, or leave it as is. At this point you can change maximum number of libraries and documents that will be listed in the view by setting those properties in the property tab of the designer.

As always, you can customize the html in the template, or leave it as is.