panelizer-view-mode.html.twig in Panelizer 8.3
Same filename and directory in other branches
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".
See also
6 theme calls to panelizer-view-mode.html.twig
- PanelizerEntityViewBuilder::buildPanelized in src/
PanelizerEntityViewBuilder.php - Build the render array for a single panelized entity.
- PanelizerEntityViewBuilder::buildPanelized in src/
PanelizerEntityViewBuilder.php - Build the render array for a single panelized entity.
- PanelizerEntityViewBuilderTest::setupView in tests/
src/ Unit/ PanelizerEntityViewBuilderTest.php - Setups up the mock objects for testing view() and viewMultiple().
- PanelizerEntityViewBuilderTest::setupView in tests/
src/ Unit/ PanelizerEntityViewBuilderTest.php - Setups up the mock objects for testing view() and viewMultiple().
- PanelizerEntityViewBuilderTest::setupView in tests/
src/ Unit/ PanelizerEntityViewBuilderTest.php - Setups up the mock objects for testing view() and viewMultiple().
File
templates/panelizer-view-mode.html.twigView source
- {#
- /**
- * @file
- * 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".
- *
- * @see template_preprocess_panelizer_view_mode()
- *
- * @ingroup themeable
- */
- #}
- <article{{ attributes }}>
- {{ title_prefix }}
- {% if title %}
- <{{ title_element }}{{ title_attributes }}>
- {% if entity_url %}
- <a href="{{ entity_url }}" rel="bookmark">{{ title }}</a>
- {% else %}
- {{ title }}
- {% endif %}
- </{{ title_element }}>
- {% endif %}
- {{ title_suffix }}
-
- <div{{ content_attributes }}>
- {{ content }}
- </div>
- </article>