How does one Render full html field from a field_target_entity ?

Created on 11 April 2018, almost 7 years ago
Updated 7 October 2024, 5 months ago

I have a file entity, with extra fields.

I am able to print out the plain text value of the field_source_full field with:

{{ content.field_slide_images|field_target_entity.field_source_full.value }}

But this field is full html and we'd hope to be able to print out the full html rendered content - not the "plain text" version.

Is this possible with some sort of render or format option?

💬 Support request
Status

Fixed

Version

1.1

Component

Documentation

Created by

🇳🇿New Zealand stewest Wellington

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • 🇭🇷Croatia devad

    Thanks @sutharsan.

    Your advice #2 worked for me when everything else failed.

    You made my day. :)

  • 🇷🇴Romania Cracu

    I struggled with this thing for a while, and while this helped, I realized that I can do something similar with "view" filter from twig_tweak module.
    That filter will extract a render array from provided field item that will look similar to what @sutharsan provided.
    E.g. in a twig for a field that is a reference you can display a formatted long text like this:

    {% for item in items %}
      <div>{{ item.content['#entity'].field_name.0|view }}</div>
    {% endfor %}
    
Production build 0.71.5 2024