file-link--card.html.twig in Open Social 8.5
Same filename and directory in other branches
- 8.9 themes/socialbase/templates/file/file-link--card.html.twig
- 8 themes/socialbase/templates/file/file-link--card.html.twig
- 8.2 themes/socialbase/templates/file/file-link--card.html.twig
- 8.3 themes/socialbase/templates/file/file-link--card.html.twig
- 8.4 themes/socialbase/templates/file/file-link--card.html.twig
- 8.6 themes/socialbase/templates/file/file-link--card.html.twig
- 8.7 themes/socialbase/templates/file/file-link--card.html.twig
- 8.8 themes/socialbase/templates/file/file-link--card.html.twig
Theme override for a link to a file for nodes.
Available variables:
- attributes: The HTML attributes for the containing element.
- link: A link to the file.
- node_icon: An icon.
See also
\Drupal\bootstrap\Plugin\Preprocess\FileLink::preprocessVariables
File
themes/socialbase/templates/file/file-link--card.html.twigView source
- {#
- /**
- * @file
- * Theme override for a link to a file for nodes.
- *
- * Available variables:
- * - attributes: The HTML attributes for the containing element.
- * - link: A link to the file.
- * - node_icon: An icon.
- *
- * @ingroup templates
- *
- * @see \Drupal\bootstrap\Plugin\Preprocess\FileLink::preprocessVariables
- */
- #}
- {{ attach_library('socialbase/file') }}
- {% spaceless %}
-
- <li class="card-file">
- <a class="card-file__link" href="{{ link.url.uri }}" title="{{ 'Open or download file'|t }}" target="_blank">
- <span class="card-file__title">{{ link.text|replace({'_': ' '}) }}</span>
- <span class="card-file__type">
- <img class="card-file__icon" src="/{{ path_to_socialbase }}/assets/images/mime-icons/icon_1_{{ node_icon }}_x16.png" srcset="/{{ path_to_socialbase }}/assets/images/mime-icons/icon_1_{{ node_icon }}_x32.png 2x" alt="{{ node_icon }}" />
- <span class="card-file__size">{{ file_size }}</span>
- </span>
- </a>
- </li>
-
- {% endspaceless %}