You are here

civicrm-entity.html.twig in CiviCRM Entity 8.3

Default template for a CiviCRM template.

The following template suggestions are available:

  • civicrm-entity--ENTITY-TYPE.html.twig
  • civicrm-entity--ENTITY-TYPE--VIEW-MODE.html.twig

Examples:

  • civicrm-entity--civicrm-event.html.twig
  • civicrm-entity--civicrm-event--teaser.html.twig

File

templates/civicrm-entity.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default template for a CiviCRM template.
  5. *
  6. * The following template suggestions are available:
  7. * - civicrm-entity--ENTITY-TYPE.html.twig
  8. * - civicrm-entity--ENTITY-TYPE--VIEW-MODE.html.twig
  9. *
  10. * Examples:
  11. * - civicrm-entity--civicrm-event.html.twig
  12. * - civicrm-entity--civicrm-event--teaser.html.twig
  13. *
  14. * @see template_preprocess_civicrm_entity()
  15. */
  16. #}
  17. {% set classes = [
  18. 'civicrm-entity',
  19. entity_type ? 'civicrm-entity--type-' ~ entity_type|clean_class,
  20. view_mode ? 'civicrm-entity--view-mode-' ~ view_mode|clean_class,
  21. ] %}
  22. <article{{ attributes.addClass(classes) }}>
  23. {{ content }}
  24. </article>