I am trying to customize a views output on a view page to wrap the fields in custom markup. I need to group a set of fields to achieve the desired layout like so:
Example:
<div class="wrapper"> {{ field.[field_name_1].content }} </div> <div class="wrapper2"> {{ field.[field_name_2].content }} {{ field.[field_name_3].content }} {{ field.[field_name_4].content }} </div>
This is what I have come up with so far:
{% if view.projects_page -%} <div class="project-img columns large-8 medium-12 small-12"> {{ field.field_project_image.content }} </div> <div class="description columns large-4 medium-10 small-12"> {{ field.field_project_header.content }} {{ field.field_sub_header.content }} {{ field.field_short_project_description.content }} </div> {%- endif %}
This doesn’t throw any errors but also doesn’t seem to work because {% if view.projects_page -%} does not target the view in the way I thought it would.
So the question is – How do I detect the view with a conditional so I get the output desired above?