My code in node--content-type.html.twig is the following.

{% autoescape false %}
  {{ node.body.value }}
{% endautoescape %}

In my node there are images, centered and with a caption, but when I view the node detail, the images are not centered because of missing figure and figcaption tags.

How can fix it?


This is my code to corrected it:

<p>{{ content|without('body') }}</p> <!--Other fields in Full content mode-->
{{ content.body }} <!--This is body field. Don't forget config show it in Full content mode-->

If someone has a better solution please help me! Sorry my English not good.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.