Adding image in a card component via file upload. Is that possible?

Created on 26 March 2025, 7 days ago

Problem/Motivation

When editing a node in layout editing mode and trying to add a Card block inside a section, I can't find an "image upload widget" to fill the image slot.

Currently, I can choose between component, block, icon, and WYSIWYG editor (see screenshot), but there’s no direct option for uploading an image. I'm not sure if this is the intended behavior, but I’d like to make things easier for editors by providing a more straightforward way to upload images.

Is there a module required to enable this functionality? I already have the usual image-related modules installed.

Thanks!

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

💬 Support request
Status

Active

Version

5.1

Component

User interface

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • 🇫🇷France Grimreaper France 🇫🇷

    Hi,

    Changing of project as this is not UI Suite Bootstrap related.

    Currently, you can define a block content type with an image field or a media field and then use it. But that's not necessarily the best way. Or use the "data from a field".

    It depends on your site structure. And not sure that it is the best experience for editors to access component directly. I think it is better to prepare block types (that will use the components with fields) and so the editors only can place blocks.

  • 🇫🇷France just_like_good_vibes PARIS

    hello,
    thank you for this interesting question :)
    so there is something very important that needs to be understood when configuring components with ui patterns.

    there are different places in a drupal site, where one is configuring a component through the user interface, thanks to ui patterns and its
    component form.
    in a block (instance placed in block layout), in views, in field ui (in manage display of an entity type of entity bundle, or field layout, layout builder)… etc
    in all those cases, the configuration of the component done in the UI will be stored as drupal config.
    And we absolutely don’t want to make references to content entities in drupal config.
    the only good case to make that, is. when the configuration of the component is stored in a content, like in the very specific case of layout builder override for example.
    sources that take external contents (files, content entities, whatever), usable in the “content”
    context, do not exist yet.
    for files and an upload form widget, we could think about storing them in the config (like base64 images?), but not sure we will go for that now.

    such sources with reference to contents will be introduced soon (more info coming soon), especially in the case of the upcoming display builder projet. they are part of the global puzzle.

    However, in a custom project, it is totally ok to create and use such sources anywhere as soon as developers are realizing what they are doing (like hardcoding in config, some references to content entities)

Production build 0.71.5 2024