You are here

insert-link.html.twig in Insert 8

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

Template file for generic links 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".
  • 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.
  • 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-link.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Template file for generic links 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. * - item: The complete item being inserted.
  12. * - name: The file name of the item being inserted.
  13. * - style_name: The style or pseudo-style name the item is inserted with.
  14. * - url: The URL to the item.
  15. * - uuid: The file's UUID.
  16. *
  17. * Some placeholders will be replaced by user-entered values when the item is
  18. * inserted into a textarea:
  19. * - __description__: A description of the item.
  20. * - __filename__: The file name.
  21. * - __description_or_filename__: A description of the item if available,
  22. * otherwise use the file name.
  23. */
  24. #}
  25. <a href="{{ url }}"{% if class %} class="{{ class }}"{% endif %} title="__description__" data-insert-type="{{ field_type }}">__description_or_filename__</a>