Drupal 8 || 9 || 10 - TWIG templates: Getting files in taxonomy terms media fields from a Drupal node
Sometimes, we have to build a file download button from a twig template. This can be done in many ways, but one of the most common use cases is to implement it directly from a twig template specific to that content type.
This gist covers a small and very specific use case where the file is part of a media type field present in a taxonomy term that is used in nodes of a content type: to extract the file path and form the download button path, we must traverse several levels..
- David Rodríguez, @davidjguru.
- Github main profile: https://github.com/davidjguru.