You are here

insert-icon-link.html.twig in Insert 8

Same filename and directory in other branches
  1. 8.2 templates/insert-icon-link.html.twig

Template file for links featuring a file icon inserted via the Insert module.

Available variables:

  • class: A set of classes assigned to this item (if any).
  • entity_type: The type of the entity inserted.
  • field_type: The field type the rendered template belongs to, i.e. "file" or "image".
  • icon_classes: Classes defining the icon appearance.
  • item: The complete item being inserted.
  • name: The file name of the item being inserted.
  • style_name: The style or pseudo-style name the item is inserted with.
  • type: file format information that may be used for setting "type" attribute.
  • url: The URL to the item.
  • uuid: The file's UUID.

Some placeholders will be replaced by user-entered values when the item is inserted into a textarea:

  • __description__: A description of the item.
  • __filename__: The file name.
  • __description_or_filename__: A description of the item if available, otherwise use the file name.

File

templates/insert-icon-link.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Template file for links featuring a file icon inserted via the Insert module.
  5. *
  6. * Available variables:
  7. * - class: A set of classes assigned to this item (if any).
  8. * - entity_type: The type of the entity inserted.
  9. * - field_type: The field type the rendered template belongs to, i.e. "file" or
  10. * "image".
  11. * - icon_classes: Classes defining the icon appearance.
  12. * - item: The complete item being inserted.
  13. * - name: The file name of the item being inserted.
  14. * - style_name: The style or pseudo-style name the item is inserted with.
  15. * - type: file format information that may be used for setting "type" attribute.
  16. * - url: The URL to the item.
  17. * - uuid: The file's UUID.
  18. *
  19. * Some placeholders will be replaced by user-entered values when the item is
  20. * inserted into a textarea:
  21. * - __description__: A description of the item.
  22. * - __filename__: The file name.
  23. * - __description_or_filename__: A description of the item if available,
  24. * otherwise use the file name.
  25. */
  26. #}
  27. <span class="file {{ icon_classes }}{% if class %} {{ class }}{% endif %}" contenteditable="false" data-insert-type="{{ field_type }}"><a href="{{ url }}" title="__description__" type="{{ type }}">__description_or_filename__</a></span>