modify elements of a Block view Drupal 8

0

Good afternoon,

I have created a block view with its respective template, I put it below:

    {%
      set classes = [
'block',
'block-' ~ configuration.provider|clean_class,
'block-' ~ plugin_id|clean_class,
     ]
     %}
 <div{{ attributes.addClass(classes) }}>
 {{ title_prefix }}
 {% if label %}
  <h2{{ title_attributes }}>{{ label }}</h2>
 {% endif %}
{{ title_suffix }}
{% block content %}
<div{{ content_attributes.addClass('content') }}>
  {{ content }}
</div>
{% endblock %}

Everything works fine, it is shown correctly with the fields that I have put in its content type but I want to modify them, I do not know what variable in twig I would have to use or what to do to collect the values of the fields.

The doubt is that I do not know how to modify the elements of block within the template at my whim.

I want to collect the values of the fields and use them at my whim.

    
asked by Fen Dev 06.01.2017 в 19:41
source

1 answer

0

I'm a little late but what you can do is call the fields you need from variable content for example {{ content.body }} {{ content.field_EL_NOMBRE_DE_TU_FIELD }} .

In the Drupal documentation you can find filters and functions that can be useful Twig in Drupal 8

    
answered by 27.06.2017 в 19:31