Provide or more twig extensions to print media attributes

Created on 25 January 2023, almost 2 years ago

Problem/Motivation

The details of the filesize and other media properties are currently buried in the field formatter.

If I need to have several differently themed download buttons in my design but want to keep the rest of the attributes I can't rely on the field formatter - even with the theme template approach proposed in #3059830.

Proposed resolution

Write a service that get's the media details. Use the same service to calculate properties for the field formatter and for a new Twig extension.

Remaining tasks

  • Write code.
  • Write tests.

User interface changes

None.

API changes

A new twig extension should be available. Ideally it would be something like the link function but with media download attributes preset.
https://www.drupal.org/docs/theming-drupal/twig-in-drupal/functions-in-t...

Data model changes

None.

Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇨🇦Canada lolcode

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

Comments & Activities

Production build 0.71.5 2024