You are here

file-link-formatter-link-separate.html.twig in File Link 8

Same filename and directory in other branches
  1. 2.0.x templates/file-link-formatter-link-separate.html.twig

Default theme implementation of a file_link with separate title and URL.

Available variables:

  • link: The link that has already been formatted by Link::fromTextAndUrl().
  • title: (optional) A descriptive or alternate title for the link, which may be different than the actual link text.
  • size: The target file size formatted according to formatter settings.
  • format: The file mime-type.

File

templates/file-link-formatter-link-separate.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation of a file_link with separate title and URL.
  5. *
  6. * Available variables:
  7. * - link: The link that has already been formatted by Link::fromTextAndUrl().
  8. * - title: (optional) A descriptive or alternate title for the link, which may
  9. * be different than the actual link text.
  10. * - size: The target file size formatted according to formatter settings.
  11. * - format: The file mime-type.
  12. *
  13. * @see template_preprocess()
  14. * @see template_preprocess_link_formatter_link_separate()
  15. *
  16. * @ingroup themeable
  17. */
  18. #}
  19. {% apply spaceless %}
  20. {{ title }}
  21. {{ link }}
  22. {% if format and size %}
  23. ({{ format }}, {{ size }})
  24. {% endif %}
  25. {% endapply %}