We have a custom block type block_countries and we are using a View(my_view_custom) to display the all the blocks where type = block_countries. Under block_countries view mode, we setup a "Full" view mode where we display certain information.
The view is displayed as a block and placed into a region (i.e. content region) from the theme. We want to style the block_countries "Full" view mode and setup a preprocess hook to do some processing, however we cannot find the way to do this.
We need help figuring out the proper twig template and preprocess_hook to call in order to get the desired out below. How can we do this?
Block type fields (block_countries):
- body
- language
- country (Entity reference: taxonomy term)
Full view mode (fields shown):
- body
- country
View settings:
- Format = unformatted list
- show: custom block: Full (where full is the view mode)
- Filter Criteria: custom block : block type = block_countries
We have tried the following but they do not work
Twig
views-view-unformatted--my-view-custom--block-1.html.twig
Hooks
mytheme_preprocess_views_view(&$vars)
mytheme_preprocess_views_view__my_view_custom(&$vars)
Desired output (per row returned from view):
<div data-country="{{ country }}"> {{ body }} </div>