2
votes

I encounter a problem with the way Drupal renders Global Custom text. I need to use Custom text field in my view to wrap fields. The body field has some "style" element inside the HTML but they are removed.

{% if field_titre_rubrique is defined and  field_titre_rubrique|length %}
    <div class="ancre" id="{{ field_ordre_rubrique }}">
        <h1 class="ancreMenu">{{field_titre_rubrique}}</h1>
        <div>
            {% if body is defined %}
               {{body}}
            {% endif %}
            {% if field_pdf is defined %}
              {{field_pdf}}
            {% endif %}
        </div>
    </div>
    <div>{{ edit_node }}</div>
{% endif %}

Do I have a solution to keep "style" elements ?

1

1 Answers

0
votes

You can use {{ body|raw }} but be sure that you can do this safely. More about this topic: https://www.drupal.org/node/2296163