'Paragraph 2 column layout
Below is my paragraph.html.twig template:
{% block paragraph %}
<div{{attributes.addClass(classes)}}>
<div{{content_wrapper_attributes}}>
{% block content %}
{{ content }}
{% endblock %}
</div>
</div>
{% endblock paragraph %}
I am trying to display fields in 2 columns as below:
fieldtitle1 value
fieldtitle2 value
fieldtitle3 value
..... ....
right now the above template prints everything row-by-row:
fieldtitle1
value
fieldtitle2
value
fieldtitle3
value
.....
....
Can someone pls guide me on how to convert this template?
Solution 1:[1]
First of all I recommend activate twig debugging for an easier templates discovery and debugging.
You are in the right paragraph.html.twig template.
You can print the {{ dump(content|keys) }} variable and see that all your fields are available there.
Field title should work with content.your_field_name.fieldDefinition.label
Field value should be accessible with content.your_field_name.value.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | milkovsky |
