Single Collection selection

Description

Let you assign one collection from the media section.

Note

This content type passes a Collection entity to the twig template. It does not provide the media entities inside of the selected collections. If you want to access the media entities of a collection, you should use a smart_content property with the media data provider or load the matching media entities in a custom controller or in a custom twig extension.

Parameters

Parameter

Type

Description

item_disabled_condition

string

Allows to set a jexl expression that evaluates if an item should be displayed as disabled. Disabled items cannot be selected.

allow_deselect_for_disabled_items

bool

Defines if the user should be able to deselect an item that is disabled. Default value is true.

request_parameters

collection

Collection of parameters that are appended to the requests sent by the selection.

resource_store_properties_to_request

collection

Collection of property names. The value of the respective properties are appended to the requests sent by the selection.

Return value

See the Collection class for available variables and functions.

Example

<property name="collection" type="single_collection_selection">
    <meta>
        <title lang="en">Collection</title>
    </meta>
</property>

Twig

{{ content.collection.fullName }}