B
B
Bogdan Zhuvak2020-06-21 01:03:21
Drupal
Bogdan Zhuvak, 2020-06-21 01:03:21

How to remove garbage when displaying drupal 8 value?

If you try to display {{ content. variable_name }}
A bunch of garbage is displayed. Here is an example:

<div data-quickedit-field-id="node/23/field_razmery_doma_1/ru/full" class="field field--name-field-razmery-doma-1 field--type-string field--label-above quickedit-field">
    <div class="field__label">Размеры дома 1</div>
              <div class="field__item">7,8x9,8</div>
          </div>

But I don't need it, I only need the value in the database. In this example, 7.8x9.8.
You need to remove such garbage not from one, but from 6-7 variables.
What is the way to do this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
andead, 2020-06-21
@SoraxBZ

Copy the core/modules/system/templates/field.html.twig template to your theme's templates folder.
Remove extra tags.
Reset cache.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question