2

I'm using Drupal 8.5. I have a content type with the in-core media module. I'm making a view for content syndication, and I need one of the columns to be the FDQN URI to the media resource-- i.e, not the rendered entity itself (which comes through as an img tag), but https://example.com/sites/default/files/media_image.jpg.

I've added the media field to my view, but I didn't find any Formatter, View Mode, or Rewrite Pattern that gives me the absolute URL to the resource. I can get the path to the media (e.g. https://example.com/media/1899), the entity_id (e.g. 1899), but no path to the file.

How can I render the path to the media image in my view?

4

The media field is an entity reference type field. You will need to add a relationship to the media entity. This should add the URI field in media entity to the view selections. You should then be able to select this (with the right reference relationship) and use the standard URL formatters.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.