# Documents list widget

## Overview

Use this widget to display a list or table of links to documents, where each document or file can be downloaded. You can choose documents or files from the already uploaded or upload new.

> info **PREREQUISITES**: You uploaded at least one document or file. For more information, see [Upload documents and files](https://www.progress.com/documentation/sitefinity-cms/upload-documents-and-files).

After you have dragged the *Documents list* widget on your page you must configure it to display documents.

To do this, click *Edit* button in the upper-right corner of the widget. In the *Documents list* window that appears, configure the following:

## Select the documents to display

1. In the *Content* tab page, choose which documents you want to display. Choose between the following options:
   * *From all libraries*\
     All documents that are uploaded and published will be displayed in the list.
   * *From selected libraries only...*\
     A custom selection of libraries is displayed.
     To select one or more libraries from which you want to display documents, click the *Select* button.
   * *From currently opened library*\
     All published documents from the currently opened library will be displayed in the list.
2. Under *Narrow the selection* you can further specify which documents or files to display by choosing one of the following:
   * *All published documents*\
     This is selected by default and displays all documents selected in the previous step.
   * *Selection of documents...*  You can narrow the displayed documents or files, using categories, tags, and dates. Select one or more of the following:
     * *Categories...*\
       Select categories from which to display documents.
     * *Tags...*\
       Select the tags by which to narrow down documents that are displayed.
     * *Date...*\
       Select one of the predefined time intervals or choose *Custom range…* to select a more specific time interval, in which the displayed documents must be created.

       > info  **NOTE**: You can select more than one filter and narrow down results using combinations of filters, for example by both categories and dates.

## List settings

List settings define how documents are listed by the *Documents list* widget. Choose one of the following options:

* *Use paging*\
  Sitefinity CMS divides the documents into pages. In the input field, specify how many documents per page to display.
* *Use limit*\
  Sitefinity CMS displays only a limited number of documents. In the input field, specify how many documents to display.
* *No limit and paging*\
  Sitefinity CMS displays all documents that meet the requirements and filters you set in the *Content* tab.
* *Sort documents*\
  By default, last published documents are listed on top. You can select a different sorting criterion:

  * *Last published*
  * *Last modified*
  * *By Title (A-Z)*
  * *By Title (Z-A)*
  * *As set in Advanced mode*\
    To sort the list of documents by property that is not defined in the sort dropdown menu, you must add a new sorting expression in the designer’s *Advanced* mode. For example, to sort documents using the *Extension* property of document, navigate to *Advanced -> Model* and, for *SortExpression*, add *Extension ASC*. As a result, in the sort dropdown menu, the *As set in Advanced mode* option is selected by default.
* *List template*\
  Select the template you want to use to list documents on the webpage.     Select one of the following:

  * *DocumentsList*\
    On the webpage, the documents are displayed in a list with their names, file types, and file sizes. Clicking the document title will open the document's detail view. You can download the files by clicking the *Download* link.
  * *DocumentsTable*\
    The documents are displayed in a table, containing file names, file types, file sizes, and a *Download* link. Clicking the document title will open the document's detail view. You can download the files by clicking the *Download* link.
* *CSS classes*\
  Expand *More options* section to specify CSS file names and apply additional CSS classes to the *Documents list* widget.

###

## Single item settings

Single item settings define how individual documents are displayed. Choose one of the following options:

* *Open single item in...*\
  Select one of the following options:

  * *Auto-generated page*\
    When you click a document, it is displayed in an automatically generated page with the same layout as the list page.
  * *Selected existing page...*\
    Select a page from the list of existing pages that has the desired layout. When you click on the document, it is displayed in this specific page.

    > info  **NOTE**: The page on which you want the document displayed, must have a *Documents list* widget added.
* *Detail template*\
  Select the template you want to use to display document's details on the webpage.
* *CSS classes*\
  Expand *More options* section to specify CSS file names and apply additional CSS classes to the *Documents list* widget.

## Advanced settings

In *Advanced* settings, you specify individual properties of the widget:

* *DetailsPageId*\
  Gets the ID of the page you selected in the *Selected exsting page...* option in the *Single item settings* tab page.
* *DetailTemplateName*\
  Gets the template you selected in the *Detail template* dropdown menu in the *Single item settings* tab page.
* *ListTemplateName*\
  Gets the template you chose in the *List template* dropdown menu in the *List settings* tab page.
* *OpenInSamePage*\
  Defines whether when you click on a document title to open the detail view in a new window  The default value is *False*.

## Model settings

Model settings display all properties directly bound to the *Documents list* widget model. Access these properties by clicking the *Model* button in *Advanced* settings.

 <table>
<colgroup><col><col></colgroup>
<tbody>
<tr>
<td>

<strong>Property</strong>

</td>
<td>

<strong>Description</strong>

</td>
</tr>
<tr>
<td>

<em>DetailCssClass</em>

</td>
<td>

Gets and sets an additional CSS class to the detail view of a document.

</td>
</tr>
<tr>
<td>

<em>DisplayMode</em>

</td>
<td>

<p>Gets the value you selected in the <em>Simple List settings</em> tab page:</p><ul>
<li><em>Paging</em><br>
This is the default option.</li>
<li><em>Limit</em></li>
<li><em>All</em></li>
</ul>

</td>
</tr>
<tr>
<td>

<em>FilterExpression</em>

</td>
<td>

Filters documents based on an additional filter expression.

</td>
</tr>
<tr>
<td>

<em>ItemsPerPage</em>

</td>
<td>

Defines the number of documents per page when paging is enabled. The default value is `20`.

</td>
</tr>
<tr>
<td>

<em>ListCssClass</em>

</td>
<td>

Gets and sets an additional CSS class to the list view.

</td>
</tr>
<tr>
<td>

<em>ParentFilterMode</em>

</td>
<td>

<p>Gets the option that you chose for libraries in the <em>Content</em> tab page. The possible values you can chose from are:</p><ul>
<li><em>All</em><br>
This is the default option.</li>
<li><em>Selected</em></li>
<li><em>CurrentlyOpen</em></li>
</ul>

</td>
</tr>
<tr>
<td>

<em>ProviderName</em>

</td>
<td>

If you have more than one providers added, you can use a document provider different than the default one. To do this, specify the name of this provider.

> info  **NOTE**: If you leave this property value empty, the default document provider is used.

</td>
</tr>
<tr>
<td>

<em>SelectionMode</em>

</td>
<td>

<p>Gets the option that you chose for documents under <em>Narrow selection by...</em> in the <em>Content</em> tab page. The possible values you can chose from are:</p><ul>
<li><em>AllItems</em><br>
This is the default option.</li>
<li><em>FilteredItems</em></li>
</ul>

</td>
</tr>
<tr>
<td>

<em>SerializedAdditionalFilters</em>

</td>
<td>

In case documents are filtered based on a date, tags, or categories, the IDs of the selected filter criteria are serialized and populated in that field.

</td>
</tr>
<tr>
<td>

<em>SerializedSelectedItemsIds</em>

</td>
<td>

In case documents are specifically selected, the IDs of the selected documents are serialized and populated in that field. <br>
For example: <code>\["3f47d0b8-2d22-6e58-888c-ff0000bfc4e0"]</code>

</td>
</tr>
<tr>
<td>

<em>SerializedSelectedParentsIds</em>

</td>
<td>

In case documents libraries are specifically selected, the IDs of the selected libraries are serialized and populated in that field.<br>
For example: <code>\["3f47d0b8-2d22-6e58-888c-ff0000bfc4e0"]</code>

</td>
</tr>
<tr>
<td>

<em>SortExpression</em>

</td>
<td>

Adds additional sorting expression for the documents. The default value is <code>PublicationDate DESC</code>.

</td>
</tr>
<tr>
<td>

<em>UrlKeyPrefix</em>

</td>
<td>

Gets or sets the URL key prefix. Used when building or evaluating URLs for paging and filtering.

</td>
</tr>
</tbody>
</table>
