How to create table of content (TOC) of a SharePoint document library?
Let’s take a SharePoint “Document Library” which has several different sub folders. For example the structure below:
Within these sub folders there are several documents stored. For example within the “Form” sub folder where documents are stored based on word or PDF file types. All sub folders within the “Information Technology” library hold several documents. The challenge I had is to create a table of content page which showed all those sub folders with their document content.
Use out of the box SharePoint blank web part page
I created a new page based on “Blank Web Part Page” and add the “Information Technology” document library which showed all the folders.
I could change current view and change the “Folders” option to show all items without folders but still this solution didn’t help. I wanted to filter individual “Document Library” sub folders and their content.
I tried all possible options with this “Information Technology” webpart to filter for a sub folder but nothing which helped me. I learned from Laura Rogers here how to insert a “Data View Web Part” and filter the content within a “Document Library”.
Some steps to achieve this:
- Create new ASPX file and attach your masterpage (Format menu –> Master Page –> Attach Master Page..)
- Create new custom content for PlaceHolderMain
- Drag your “Document Library” in the content area you want to show
- Make sure you are in the table and in the task pane go to “Data Source Details” and click the Current Data Source link.
- Change the scope level to RecursiveAll
- We are done now and all documents will be shown stored in this “Document Library”. Now we can filter the path for specific Sharepoint sub folders. Click on the chevron of the data view and click Filter.
- The Filter Criteria window is shown and you can set all different type of criteria. Enter the sub folder you want to show. In my case the Form folder.
- Save the ASPX file and check it out.
Hopefully by now you get the picture how to customize the data view webpart. You can change all columns and insert hyperlinks were needed.