The Feather document selector enables you to display and retrieve one or several selected documents.
Using the document selector, you can:
NOTE: You can change the document selector's behavior by editing the widget properties in the Advanced settings section.
The documents you select are kept in a scope array variable. The default template visualizes documents using the sfCollection directive. For more information, see Feather: 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. For more information, see Feather: Use content selectors outside of widget designer views.
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:
The sfDocumentSelector directive exposes the following attributes:
The following example demonstrates how to add a document selector directive in a widget designer's view.
To enable AngularJS to link the sfDocumentSelector directive in your custom designer view, you must load the script of the directive and add a dependency to the module:
The code above displays all documents and enables you to select and deselect any of them because both the sf-deselectable and sf-multiselect attributes are present. The values of the selected documents are kept in the selectedItems array.
To provide notification when an document is uploaded, the sfDocumentSelector directive emits a custom selection event. To subscribe to the selection event, see the code sample in Step 2 above.
Back To Top