Split issue #2701463: Make "Download link" field formatter translatable

It would be great to be able to hide tile file size that is automatically added on the side of the download button, when using "Download link" as display formater

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

matsbla created an issue. See original summary.

joachim’s picture

Here's a patch that's basically just the relevant parts pulled out of the patch at #2701463: Make "Download link" field formatter translatable, with tweaks for bits that didn't apply to latest dev.

Credit should go to https://www.drupal.org/u/devdokimov.

slashrsm’s picture

+++ b/templates/file-entity-download-link.html.twig
@@ -34,5 +34,7 @@
-    <span class="file-size">({{ file_size }})</span>
+    {% if file_size|default is not empty %}
+        <span class="file-size">({{ file_size }})</span>
+    {% endif %}

Why do we need |default in this condition?