I'm trying to use entity embed with a media document and display modes seem to work nicely. But how can I link the media name to the document directly? File names are often quite cryptic, so it would be nice to display the media name and link it directly to the file field of the media entity. Currently there is only option to " Link to the Media".

Comments

mErilainen created an issue. See original summary.

marcoscano’s picture

Issue tags: +D8Media

Have you tried the Field Formatter module?

One possible solution (not sure if the only one) is to use that module to help with the formatter you need.

With that module installed (make sure you install a recent version, this new feature was added recently), you can configure your setup the following way:

1- In your document media entity, create a viewmode (or use the default) with only the document field visible
2- Configure the formatter of this field to be rendered as "Field linker", leave the formatter config as default
3- When embedding the document, choose the formatte "Rendered entity" and select the viewmode on the media entity that you just configured before.

The result will be a direct link to the document, embedded into your wisywig text.

NerOcrO’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.