Document selector | MVC
The document selector enables you to display and retrieve a specific document.
Using the document selector, you can:
- Select and deselect documents
- Upload a document by either selecting it from a list, or using drag and drop
- Search for documents in the currently opened library or in all libraries
- Select the provider from which to retrieve documents
- Filter documents by Libraries, Categories, Tags, or Dates
- Sort documents by Title, Date created, or Date modified
NOTE: You can change the document selector's behavior by editing the widget properties in the Advanced settings section.
The document you select are kept in a scope array
variable. The default template visualizes documents using the sfCollection
directive. For more information, see Use a generic collection directive.
You can use the document selector in the frontend, as well as in the backend. For example, on a page, as well as in a widget designer.
The sfDocumentSelector
is a directive with an isolated scope that is defined in a module with the same name: sfDocumentSelector
.
The following image is an example of an document selector:

In your DesignerView.YourView.cshtml
file, place one of the following tags anywhere in the HTML code:
The values of the attributes are scope properties that you define in the MVC widget controller.
Attribute |
Description |
sf-model
|
Accepts a scope variable that holds the selected items. |
sf-filter
|
Accepts a filter object to use when filtering displayed items. |
sf-provider
|
Accepts a provider name to use when retrieving the items to display. |
sf-template-url
|
Allows you to override the template of the document selector. |
sf-template-assembly
|
Specifies the assembly where the template of the document selector is located. |