- Issue created by @Andrés Chandía
- Assigned to viren18febS
- Issue was unassigned.
- Status changed to Needs review
about 1 year ago 12:09pm 25 August 2023 - 🇮🇳India viren18febS
HI @Andrés Chandía
Please refer this code sample, As per the twig template, we need to apply the for loop first & then add these
conditions into the loop.{% for item in items %} <tr> <td> {% if item.field_name.0.value == '1' %} apple {% endif %} {% if item.field_name.0.value == '2' %} banana {% endif %} {% if item.field_name.0.value == '3' %} kiwi {% endif %} {% if item.field_name.0.value == '4' %} orange {% endif %} </td> <td> blahblah </td> </tr> {% endfor %}
- 🇨🇱Chile Andrés Chandía
Thanks a lot viren18febS → , and sorry for my ignorance...
but can you explain me in detail what you mean byPlease refer this code sample, As per the twig template, we need to apply the for loop first
- 🇮🇳India viren18febS
You need to create the twig file first & then use above code into the twig file for replacing the values.
- Status changed to Postponed: needs info
about 1 year ago 2:25pm 28 August 2023 - 🇺🇸United States smustgrave
@Andrés Chandía does that answer your question?
- 🇨🇱Chile Andrés Chandía
Sorry, I'm learning about twig thing, to be able to carry out the solution given by viren18febS →
Thanks for asking... - Status changed to Fixed
about 1 year ago 2:31pm 28 August 2023 - 🇺🇸United States smustgrave
No worries going to mark this answered in the meantime
Here's more links that may help
https://www.drupal.org/docs/develop/theming-drupal/twig-in-drupal → - 🇨🇱Chile Andrés Chandía
Hi viren18febS, sorry but I'm seem not being able to accomplish this, due to my lack of experience of course...
I could find that the twig file managing the cell I need to modify is:
`views-view-field.html.twig`
SO Automatically closed - issue fixed for 2 weeks with no activity.