Media selection =============== Description ----------- Shows a list with the possibility to assign some assets from the media section to a page. Also allows to define a position, which can be handled later in the template. Parameters ---------- .. list-table:: :header-rows: 1 * - Parameter - Type - Description * - types - string - A comma separated list of available asset types to assign. Each item in the list must be one of ``document``, ``image``, ``video`` or ``audio``. * - displayOptions - collection - A collection of booleans, which defines to which positions the assets can be assigned (``leftTop``, ``top``, ``rightTop``, ...) * - defaultDisplayOption - string - Defines which of the displayOptions is the default one Example ------- .. code-block:: xml Images Twig ---- .. code-block:: twig {% for image in content.images %} {{ image.title }} {% endfor %} If your property defines ``displayOptions``, you can access the selected ``displayOption`` via ``view..displayOptions``: .. code-block:: twig
{% for image in content.images %} {{ image.title }} {% endfor %}
If you want to provide a link for downloading a document, you can use ``.url`` attribute or wrap it with the :doc:`sulu_get_media_url <../twig-extensions/functions/sulu_get_media_url>` to control which `disposition header`_ the target url should use: .. code-block:: twig