- Issue created by @nitesh624
- 🇺🇸United States cilefen
That may be what Twig does when there are null pointers on objects. I would consult Twig’s documentation.
- 🇮🇳India nitesh624 Ranchi, India
thanks cilefen. Do you have link to documentation around this twig filter stuff?
- 🇺🇸United States cilefen
Twig syntax is documented here: https://twig.symfony.com/doc/3.x/templates.html
- 🇮🇳India nitesh624 Ranchi, India
I guess the problem is in the template itself
1. I have added a taxonomy reference field (field_taxonomy_ref) in article content type.
2. Then innode--article.html.twig
file I print{{ dump(node.field_taxonomy_ref.entity) }}
, Which returnstaxonomy entity object
when there is data in this field but when this field is left empty then I am getting node object. - 🇮🇳India nitesh624 Ranchi, India
what is the proper method to get the reference entity object in node template. so that when there is no data in field reference then I will get null instead of node object.
- Status changed to Closed: works as designed
3 months ago 8:10am 29 May 2024