Client has a custom Content Type for for downloadable PDF document detail pages, which contains an entity reference to the File media type.
They want Full and Teaser view modes to display a thumbnail image, user-friendly title (not PDF filename), and link to download.
I added the
field_media_image to the media file bundle, and I used the media file's Name field for the "friendly name" of the file.
The image and name could be edited by clicking the pencil icon on the image field to edit the media file directly, but it is a better user experience for content editors to edit the media file attributes from the detail page node, along with the rest of the document details.
If I change the field widget for the entity reference in the detail page's form display from Media library to Entity browser these fields are easy to edit from the detail page node by clicking the Edit button.
This works well for editing existing content, but this widget is not configured correctly for uploading new PDF content:
There are some customizable widget settings in the form display configuration, but nothing that seems useful for my purposes.
The client is accustomed to uploading PDFs using the Media library widget, which looks like this:
Unfortunately, the Media library widget does not allow user to edit fields on the media file bundle. This widget does not offer any customizable settings in the form display configuration.
Is it possible to write a small Drupal 8 module to use the Media library widget on this field if it is empty (or
NULL), but use the Entity browser widget on this field if a PDF has been uploaded?
That would be ideal. If it's not possible, perhaps someone can help me to configure the Entity browser widget to behave more like the Media library widget for PDF uploads.
I think I might be on the right track:
Home >> Administration >> Configuration >> Content authoring >> Entity Browsers
I'm trying to add a new PDF Entity Browser. But when I use that, I get the following error message:
What am I missing?