palasangha / Treasures-Of-Dhamma

GNU General Public License v3.0
0 stars 0 forks source link

Twig Template - Taxonomy term value not displayed #2

Closed paladhamma closed 2 years ago

paladhamma commented 2 years ago

Added the taxonomy field created in webform here in twig template as other fields, saved. On viewing the content the taxonomy term's ID is displayed rather than the value. Eg: Say Mango is mapped with id 21. Then 21 is displayed rather than Mango.

paladhamma commented 2 years ago

To fetch the taxonomy term rather than id- use the following code mentioned below: {{ drupal_entity('taxonomy_term',data.field_name) }}

Eg: Mango has id 21 - it's field name is say mango - type use {{ drupal_entity('taxonomy_term',data.mango) }} then Mango will be displayed here.