Output all instances of a repeating field together I have Paragraphs installed and am creating a content-type which has nested Paragraphs - so there is a Paragraph with a Title Field, a Body Field - this is then nested in a another Paragraph, so that I can have several boxes across the page. So far so good - what I want to learn is to output the fields so I can put them in jQuery UI tabs.

In my template I currently have:

{{ content.field_tab_title }}
{{ content.field_body }}


Which outputs:
Title Body Title Body Title Body etc.

What I need is:
Title Title Title Body Body Body

So that I can put all the titles in li's for jQuery UI. I've tried putting

{% for item in items %} {{ content.field_tab_title }} {% endfor %} 


But then nothing comes out at all.

UPDATE
Following Kevin's Suggestions, I've started again with my templates and have now got;

in paragraph--tab.html.twig:

&lt;ul class="tab-box"&gt;
{{ content.field_tab_title }}
&lt;/ul&gt;
&lt;div&gt;{{ content.field_body }}&lt;/div&gt;


and in field--paragraph--tab.html.twig:

{% for item in items %} 
  &lt;li class="tab-title"&gt;{{ item.content }}&lt;/li&gt; 
{% endfor %}


but this is still outputting: 

&lt;ul&gt;&lt;li&gt;Tab Title - 1&lt;/li&gt;&lt;/ul&gt;
&lt;div&gt;Body Copy 1&lt;/div&gt;
&lt;ul&gt;&lt;li&gt;Tab Title - 2&lt;/li&gt;&lt;/ul&gt;
&lt;div&gt;Body Copy 2&lt;/div&gt;


But what I need is:

&lt;ul&gt;&lt;li&gt;Tab Title - 1&lt;/li&gt;&lt;li&gt;Tab Title - 2&lt;/li&gt;&lt;/ul&gt;
&lt;div&gt;Body Copy 1&lt;/div&gt;
&lt;div&gt;Body Copy 2&lt;/div&gt;
This is going to be tricky, but you will need to think through the rendering layers via twig and work inside out.

Example, if you need all field tab titles in li's, the twig for field tab title (field--field-tab-title.html.twig) should look something like this:

{% for item for items %} 
  &lt;li class="tab-title"&gt;{{ item }}&lt;/li&gt; 
{% endfor %} 


In your Paragraph field twig, you would put the wrappers as needed, like:

&lt;ul class="tabs"&gt;
  {{ content.field_tab_title }}
  {{ content.field_tab_body }}
&lt;/ul&gt;


The same applies to Body:

{% for item for items %} 
  &lt;li class="tab-body"&gt;{{ item }}&lt;/li&gt; 
{% endfor %} 


Here is a similar example perhaps you can follow. This isn't tabbed content, but it is accordion based, so it is similar. Still paragraphs.

Main container (paragraph--component):

&lt;div{{ attributes.addClass(classes) }}&gt;
  {% block content %}
    {{ content }}
  {% endblock %}
&lt;/div&gt;


Main accordion paragraph twig, extends the main container (paragraph--component is a custom twig suggestion I made for easier theming):

{% extends 'paragraph--component.html.twig' %}

{% set attributes = attributes.addClass('c-accordion') %}

{% block content %}
  {{ content }}
{% endblock %}


The accordion item itself, containing a title and other fields:

&lt;section class="c-accordion__item"&gt;
  &lt;input type="checkbox" class="c-accordion__trigger visuallyhidden" id="step-{{ paragraph.id() }}" /&gt;
  &lt;label for="step-{{ paragraph.id() }}" class="c-accordion__header"&gt;
    {% if paragraph.field_accordion_step_title is not empty %}
      &lt;h4 class="c-accordion__step"&gt;{{ content.field_accordion_step_title }}&lt;/h4&gt;
    {% endif %}
    &lt;h5 class="c-accordion__title"&gt;{{ content.field_accordion_title }}&lt;/h5&gt;
  &lt;/label&gt;
  &lt;div class="c-accordion__body"&gt;
    &lt;div class="c-accordion__description"&gt;{{ content.field_accordion_body }}&lt;/div&gt;
  &lt;/div&gt;
&lt;/section&gt;


When this renders, all X accordion items are rendered the same way into one container. Granted, in my example, the markup container for fields live outside of the field twig and in this twig here, because I chose to have 0 field markup in that project. You can go either way you want.