You are here

panelizer-view-mode.html.twig in Panelizer 8.3

Template for a generic Panelizer view mode.

Available variables:

  • entity: The entity with limited access to object properties and methods.
  • attributes: HTML attributes for the containing element.
  • content: All entity items.
  • entity_url: Direct URL of the current entity.
  • title: The title of the entity.
  • title_element: HTML element to use for the title (defaults to 'h2').
  • title_attributes: Same as attributes, except applied to the main title tag that appears in the template.
  • title_prefix: Additional output populated by modules, intended to be displayed in front of the main title tag that appears in the template.
  • title_suffix: Additional output populated by modules, intended to be displayed after the main title tag that appears in the template.
  • view_mode: View mode; for example, "teaser" or "full".

File

templates/panelizer-view-mode.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Template for a generic Panelizer view mode.
  5. *
  6. * Available variables:
  7. * - entity: The entity with limited access to object properties and methods.
  8. * - attributes: HTML attributes for the containing element.
  9. * - content: All entity items.
  10. * - entity_url: Direct URL of the current entity.
  11. * - title: The title of the entity.
  12. * - title_element: HTML element to use for the title (defaults to 'h2').
  13. * - title_attributes: Same as attributes, except applied to the main title
  14. * tag that appears in the template.
  15. * - title_prefix: Additional output populated by modules, intended to be
  16. * displayed in front of the main title tag that appears in the template.
  17. * - title_suffix: Additional output populated by modules, intended to be
  18. * displayed after the main title tag that appears in the template.
  19. * - view_mode: View mode; for example, "teaser" or "full".
  20. *
  21. * @see template_preprocess_panelizer_view_mode()
  22. *
  23. * @ingroup themeable
  24. */
  25. #}
  26. <article{{ attributes }}>
  27. {{ title_prefix }}
  28. {% if title %}
  29. <{{ title_element }}{{ title_attributes }}>
  30. {% if entity_url %}
  31. <a href="{{ entity_url }}" rel="bookmark">{{ title }}</a>
  32. {% else %}
  33. {{ title }}
  34. {% endif %}
  35. </{{ title_element }}>
  36. {% endif %}
  37. {{ title_suffix }}
  38. <div{{ content_attributes }}>
  39. {{ content }}
  40. </div>
  41. </article>