Print only the first *text* paragraph

This commit is contained in:
benjamin melançon 2019-01-21 00:30:47 -05:00
parent 183434e5ba
commit 29f7fce47f

View file

@ -34,11 +34,17 @@
* - label_display: The display settings for the label. * - label_display: The display settings for the label.
* *
* @see template_preprocess_field() * @see template_preprocess_field()
{% for i, paragraph in content.field_body_paragraph if i|first != '#' %}
*/ */
#} #}
<description> <description>
{% for item in items %} {% set one_and_done = false %}
{{ item.content|render|escape }} {% for item in items if not one_and_done %}
{{ item.content['#paragraph'].type.0.entity.id }}
{% if item.content['#paragraph'].type.0.entity.id == 'text' %}
{% set one_and_done = true %}
{{ item.content|render|escape }}
{% endif %}
{% endfor %} {% endfor %}
{# the closing description tag is found in the RSS view template so that we can {# the closing description tag is found in the RSS view template so that we can
add a Read more link — we don't have the node information to make it here! add a Read more link — we don't have the node information to make it here!