Add media reference to the same field type group as file and image

Created on 17 January 2025, about 2 months ago

Problem/Motivation

While discussing ๐Ÿ“Œ Refine field descriptions Active at ๐Ÿ“Œ Drupal Usability Meeting 2025-01-17 Active , we agreed that the Media option should be part of the same group as File and Image uploads. Although these options are very different in terms of implementation, they are similar in how they are used.

For a long time, we have had the description text,

Use Media reference fields for most files, images, audio, videos, and remote media. Use File or Image reference fields when creating your own media types, or for legacy files and images created before installing the Media module. For more information, see the Media help page.

A more effective way to make this distinction would be to have all three options on the same screen.

Proposed resolution

Instead of showing Media as a separate option on admin/structure/types/manage/page/fields/add-field (Add field: Choose a type of field), add it to the next step of the form, after selecting "File upload".

Revise the text for that field group (currently "File upload").

Remaining tasks

User interface changes

Before

Choose a type of field:

After selecting Media:

After selecting File upload:

Introduced terminology

None

API changes

None

Data model changes

None

Release notes snippet

N/A

๐Ÿ“Œ Task
Status

Active

Version

11.0 ๐Ÿ”ฅ

Component

field system

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States benjifisher Boston area

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

Comments & Activities

  • Issue created by @benjifisher
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States benjifisher Boston area

    I know there was previous discussion of this decision. We should find and review that discussion before moving forward with this issue.

    At the usability meeting, we also noticed that there is another path to add a media reference: on the first step of the form, choose Reference; then select Other; then choose Media from the "Type of item to reference" select list.

    The media module lists the file module as a dependency, so we do not have to worry about the case where Media is available but File upload is not.

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany rkoller Nรผrnberg, Germany

    About the previous discussion, @lauriii summarized it in #3370326-4: Refine field descriptions โ†’ :

    The file upload group was created based on a card sort exercise we ran earlier this year. The results we got from there were pretty clear that people tend to map both image uploads and file uploads together. That said, Media was a challenging one; some people listed it under reference and some people listed it under file upload. That's why we decided to move it to the main level to try to address this challenge.

    One of the use cases we tested as part of the usability testing was image and media fields because we had similar concerns that it might not be intuitive. However, both existing and new users were able to find the fields and we didn't find any challenges with the current sorting so we decided to proceed with that.

    and about the point people were able to find fields... when i first tested the new add field functionality i had a real hard time finding the image field type, i havent expected or even considered to look under the file upload group for the image field type.

    personally i am a heavy +1 on moving media, file, and image field types into a group together.

    In regard of the micro copy for the group two suggestions:

    group label: Media assets (or just Assetsto keep things even more generic)
    group description: Create media type with the ability to upload or link assets

    suggestions were taken from https://docs.google.com/spreadsheets/d/1Lx7L40eRHotr5KQGn6au5WxQO3lFv19a...

  • ๐Ÿ‡ซ๐Ÿ‡ฎFinland lauriii Finland

    FWIW, this was tested with users back in 2023 and it tested quite well. We specifically tested adding images to a content type and most users went ahead and used the media option for that without hesitation. I can see how the current categorization makes the image field harder to find but it's also used much less frequently. If you're using media, wouldn't you only use that to create an image media type which would be added by default to fit majority of the use cases.

    In general I'm not sure we should be making individual changes like this without first validating that the plan works out holistically. It would be great if we could build a prototype in ๐Ÿ“Œ Refine field descriptions Active for the proposed new descriptions and categories. Then those could be validated to make sure that at least the key journeys remain easy.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States benjifisher Boston area

    @lauriii:

    Can you give a link to the script used for user testing and the results? If one of the tasks was to attach a media reference field to a content type, then it is not surprising that putting the option at the top level tested well. It is like a self-fulfilling prophecy. Did the test also ask users to attach a non-reusable image field?

    The key difference between Image media and Image (file) fields is that media are reusable, and image fields are not. There are use cases for both. If someone chooses Media, reads the rather long description, and decides that they actually want an image field, then they have to back up, figure out that "File upload" is the right group, and choose that. It would be much easier if, at the time they read about the distinction, the other option were right there.

    The usability team has spent a lot of effort on #3346539 recently. Any input there is very welcome. We added this issue because the suggestion came up while we were working on that issue, and we wanted to keep the discussion focused on the descriptions.

  • ๐Ÿ‡ซ๐Ÿ‡ฎFinland lauriii Finland

    Here's the script that was used for the research: https://docs.google.com/document/d/1Usb6nOkNC9JeLelGl1zis-P_IbEzKrzxx5-1.... Specifically the task related to this was attaching images to the content type. We did not specifically ask users to attach a non-reusable image field because that is a significantly less important use case. There are valid use cases for it though like uploading a profile picture. I did a quick pass and couldn't find the summary of the results.

    I'm not saying that the proposal you've made isn't good. Media was hardest to come to something sensible so I'm not surprised it's coming up as something that we may want to change. It also has the added description text which I fully support getting rid of if we can. However, I would feel more confident with the direction if we were able to validate that our hypothesis on these improvements are true.

    It would be great if we could build a prototype with the proposed changes and then evaluate the next steps based on that.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States benjifisher Boston area

    @lauriii:

    Thanks for the link to the user-test script.

    Making a prototype will be easy. Coming up with good interface text is hard, and that is what the usability team has been working on. Organizing user tests is also hard, and it will be great if you can manage that step.

Production build 0.71.5 2024