Download links template

Created on 19 June 2019, about 6 years ago
Updated 1 July 2025, 2 days ago

Hi all,

Here is the template file audiofield/templates/audiofield-download-links.html.twig...

{#
/**
 * @file
 * Default theme implementation for AudioField audioplayer download links.
 *
 * Available variables:
 * - links: downloa
 *
 * @ingroup themeable
 */
#}
<table class="audiofield-downloads">
  <caption>{{ 'Download files:'|trans }}</caption>
  {% for file in links %}
    <tr>
      <td class="audiofield-download-link">{{ file.link }}</td>
    </tr>
  {% endfor %}
</table>

...which renders like this:

How can I change it to an image link ie something like:

I have copied the template to my theme and can see the template is working. I thought {{ file.link }} would give me the download link so

<a href="{{ file.link }}"><img src="/download-icon.jpg"></a>

but {{ file.link }} outputs nothing.

Thanks...

๐Ÿ’ฌ Support request
Status

Active

Version

1.9

Component

Code

Created by

๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom juc1

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024