Twig | Drupal at your Fingertips #126
Replies: 2 comments 4 replies
-
Hello Selwyn! Thank you for this incredible resource. We have a policy to referenced entitles (child paragraphs, entity reference fields) independently, meaning that if "foo" is referencing "bar" then I will print {{ content.bar }} and then the "bar" will print as the View Mode defined in the field formatter definition for "bar" on "foo". This allow the site builder to easily control how the field is rendered through the interface, the interface is the single-source of truth for how a field is rendered. In this section [https://selwynpolit.github.io/d9book/twig#entity-reference-destination-content], I see printing fields on "bar" but they aren't subject to any View Mode settings. Do you know how to do what what's happening in section but instead of accessing the field value directly, instead render that field through a defined View Mode? |
Beta Was this translation helpful? Give feedback.
-
I did. It's brilliant!
… On Jul 2, 2024, at 8:32 AM, Selwyn Polit ***@***.***> wrote:
@stephencapellic <https://github.com/stephencapellic> Did you try that code? It looks pretty sane to me.
—
Reply to this email directly, view it on GitHub <#126 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ADEEKCFX2E2OGEYYE6WOU4DZKKTXBAVCNFSM6AAAAABKD7J5EKVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TSMZWHE4TO>.
You are receiving this because you were mentioned.
|
Beta Was this translation helpful? Give feedback.
-
Twig | Drupal at your Fingertips
Drupal at your Fingertips: A developers quick reference for Drupal 9 and 10
https://selwynpolit.github.io/d9book/twig
Beta Was this translation helpful? Give feedback.
All reactions