file-link.html.twig in Open Social 8
Same filename and directory in other branches
- 8.9 themes/socialbase/templates/file/file-link.html.twig
- 8.2 themes/socialbase/templates/file/file-link.html.twig
- 8.3 themes/socialbase/templates/file/file-link.html.twig
- 8.4 themes/socialbase/templates/file/file-link.html.twig
- 8.5 themes/socialbase/templates/file/file-link.html.twig
- 8.6 themes/socialbase/templates/file/file-link.html.twig
- 8.7 themes/socialbase/templates/file/file-link.html.twig
- 8.8 themes/socialbase/templates/file/file-link.html.twig
Theme override for a link to a file for forms (default).
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
1 theme call to file-link.html.twig
- FieldDownloadCount::viewElements in modules/custom/ download_count/ src/ Plugin/ Field/ FieldFormatter/ FieldDownloadCount.php 
- Builds a renderable array for a field value.
File
themes/socialbase/templates/file/file-link.html.twigView source
- {#
- /**
- * @file
- * Theme override for a link to a file for forms (default).
- *
- * 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 %}
-   <span{{ attributes }}>
- 
-   {% if icon_only %}
-     <span class="file-icon"><img class="node-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>
-     <span class="sr-only">
-       <span class="file-link">{{ link }}</span>
-       <span class="file-size">{{ file_size }}</span>
-     </span>
-   {% else %}
- 
-       <span class="file-icon"><img class="node-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><span class="file-link">{{ link }}</span><span class="file-size">{{ file_size }}</span>
- 
-   {% endif %}
- 
-   </span>
- 
- 
- {% endspaceless %}
