I'm trying to figure how I can obtain or print the file description that is uploaded on my node and display on my twig template
So far I have tried {{ file.entity.label }}
which only prints the name of the file. I even tried {{ file.entity.value }}
or {{ file.entity.title }}
.
Here is a sample of the code I have been working on
{% for file in object.entity.field_file %}
<li>{{ file.entity.label }} {{ file_url(file.entity.uri.value) }}</li>
{% endfor %}
{{ item.entity.description.value }}
page.html.twig
page.html.twig
shouldn't be the template to print field content like that. A new custom field formatter would be the way to go. But nevertheless what makes me really wonder is why as in your screenshot the description seems to be just empty""
.