paragraphs-summary.html.twig in Paragraphs 8
Default theme implementation for a paragraphs summary.
Available variables:
- expanded: Whether the summary is expanded or not.
- content: Array of content summary items.
- behaviors: Array of behavior summary items.
See also
5 theme calls to paragraphs-summary.html.twig
- InlineParagraphsWidget::formElement in src/
Plugin/ Field/ FieldWidget/ InlineParagraphsWidget.php - Uses a similar approach to populate a new translation.
- Paragraph::getSummary in src/
Entity/ Paragraph.php - Returns a short summary for the Paragraph.
- ParagraphsSummaryFormatter::viewElements in src/
Plugin/ Field/ FieldFormatter/ ParagraphsSummaryFormatter.php - Builds a renderable array for a field value.
- ParagraphsWidget::buildNestedParagraphsFoDragDrop in src/
Plugin/ Field/ FieldWidget/ ParagraphsWidget.php - Builds the nested drag and drop structure.
- ParagraphsWidget::formElement in src/
Plugin/ Field/ FieldWidget/ ParagraphsWidget.php - Uses a similar approach to populate a new translation.
File
templates/paragraphs-summary.html.twigView source
- {#
- /**
- * @file
- * Default theme implementation for a paragraphs summary.
- *
- * Available variables:
- * - expanded: Whether the summary is expanded or not.
- * - content: Array of content summary items.
- * - behaviors: Array of behavior summary items.
- *
- * @see template_preprocess()
- *
- * @ingroup themeable
- */
- #}
- {% set classes = [
- 'paragraphs-description',
- expanded ? 'paragraphs-expanded-description' : 'paragraphs-collapsed-description'
- ] %}
- {% spaceless %}
- {% if content is not empty or behaviors is not empty %}
- <div{{ attributes.addClass(classes) }}>
- {% if content is not empty %}
- <div class="paragraphs-content-wrapper">
- {%- for content_item in content -%}
- <span class="summary-content">{{ content_item }}</span>
- {%- if not loop.last -%}, {% endif %}
- {%- endfor -%}
- </div>
- {% endif %}
- {% if behaviors is not empty %}
- <div class="paragraphs-plugin-wrapper">
- {%- for behavior_item in behaviors -%}
- <span class="summary-plugin">
- {%- if behavior_item.label is not null -%}
- <span class="summary-plugin-label">{{ behavior_item.label }}</span>
- {%- endif -%}
- {{ behavior_item.value -}}
- </span>
- {%- endfor -%}
- </div>
- {% endif %}
- </div>
- {% endif %}
- {% endspaceless %}