Exclude fields from printing in Twig I am overriding the fields template

views-view-fields--machine_name.html.twig

I want to render some Fields in a different div than the other fields.  I do not want the fields to render twice.

&lt;div class="foo"&gt;
  {{ fields.field_events_date_start.content }}
  {{ fields.field_events_date_start_1.content }}
&lt;/div&gt;

{% for field in fields -%}
  {{ field.separator }}
  {%- if field.wrapper_element -%}
    &lt;{{ field.wrapper_element }}{{ field.wrapper_attributes }}&gt;
  {%- endif %}
  {%- if field.label -%}
    {%- if field.label_element -%}
      &lt;{{ field.label_element }}{{ field.label_attributes }}&gt;{{ field.label }}{{ field.label_suffix }}&lt;/{{ field.label_element }}&gt;
    {%- else -%}
      {{ field.label }}{{ field.label_suffix }}
    {%- endif %}
  {%- endif %}
  {%- if field.element_type -%}
    &lt;{{ field.element_type }}{{ field.element_attributes }}&gt;{{ field.content }}&lt;/{{ field.element_type }}&gt;
  {%- else -%}
    {{ field.content }}
  {%- endif %}
  {%- if field.wrapper_element -%}
    &lt;/{{ field.wrapper_element }}&gt;
  {%- endif %}
{%- endfor %}


If I exclude those Fields from the display in Views it hides them both when they render before and in the normal content area.

{{ content|without('field_events_date_start,field_events_date_start_1') }}


...Does not work because I am rendering Fields, not content.

How do I get the fields to render before, but be excluded later?
You would have to remove the two fields from fields.

&lt;div class="foo"&gt;
  {{ fields.field_events_date_start.content }}
  {{ fields.field_events_date_start_1.content }}
&lt;/div&gt;

{% for field in fields|without('field_events_date_start',  field_events_date_start_1') %}
  ...
{% endfor %}