I'm trying to output paragraph field values in a sample paragraph template, but it does not work. I created a twig template in paragraph/paragraph--article--default.html.twig

I have a field called field_action and I tried:

{% block paragraph %}
    <div{{ attributes.addClass(classes) }}>
      {% block content %}

      {% endblock %}
{% endblock paragraph %}

Nothing happens.

If I write {{content}} everything is fine, but I would like to customize output.

  • 1
    Is the block content necessary? Otherwise this should work fine.
    – Kevin
    Jan 17 '19 at 16:12

To print out single fields I usually use, {{ paragraph.field_action.value }}. That should also work for you.

In the case of an entity reference field, you need to use {{ paragraph.field_action.entity.field.value }}.


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.