I have a view which returns rows of entities. Each entity has several multi-value fields.
The structure is kinda like this:
Field 1:
- Item A
- Item B
- Item C
- ...
- Item H
Field 2:
Field 2 holds values that are related to Field 1 Item B.
When displaying Field 1 in the view results I'd like to be able to display them like:
Field 1:
Item A, Item B (Field 2 Item A, Field 2 Item B), Item C, Item D
Because its a multi value field Views is using the item_list template. My plan was that I would adds some conditionals to this template so that if Field 1 Item B was to be shown, I would use Twig Tweak to add the values from Field 2 inline to it. The only problem is that to do that I need the row's entity ID. For the life of me, I can't figure out how to pass this information into the item_list template. This template seems completely removed from the view and doesn't have a way to reference it.
I've been trying various functions in my theme file to get the result row NID and pass it along as a variable into the list_item template, but have had nothing but failure. I've figured out how to get a custom variable into the item_list template preprocess_item_list, but I can't figure out how to get the row NID into this function.
Any help would be appreciated.