It would be great if it would be possible to select a media entity (or image as a file entity), so I could get its ID or path and use it using twig_tweak module. Is this a planned feature?

Comments

milos.kroulik created an issue. See original summary.

milos.kroulik’s picture

Title: Select media in setting form? » Add media (or image) setting type

Update issue name

christian.wiedemann’s picture

Hi Milos, I am not sure about this feature. Actually, UI Patterns Settings is to configure an existing pattern. And linking media which is content is actually not intended.
But there are use cases from my point of view. Especially when you use it together with layout builder.

It is not planned but it is very easy to write own setting types. Maybe a contrib module ui_pattern_settings_media.

christian.wiedemann’s picture

Hi I added a new SettingType media_library which uses https://www.drupal.org/project/media_library_form_element as widget. Optionally you can specify an view_mode to render the media entity.

christian.wiedemann’s picture

Status: Active » Fixed
christian.wiedemann’s picture

Status: Fixed » Closed (fixed)
christian.wiedemann’s picture