{# "Campaign" block view template. #}
{# One block can contain one or several "block items". #}
{# Those items are passed from the PageController as "valid_items" and "valid_contentinfo_items" #}
{% set several = valid_items|length > 1 %}
<
{# If we have only one item, display build a link to it. Otherwise let Javascript do its job. #}
>
{# Loop over items as ContentInfo objects to display the content name #}
{% for contentInfo in valid_contentinfo_items %}
{{ ez_content_name( contentInfo ) }}
{% endfor %}
{# Now loop over block items to display them. #}
{# Block items are eZ\Publish\Core\FieldType\Page\Parts\Item objects #}
{# Render each location using a specific "block_item_campaign" view type. #}
{# image_class param will be used in sub-template. #}
{% for item in valid_items %}
{{ render(
controller(
'ez_content:viewLocation',
{
'locationId': item.locationId,
'viewType': 'block_item_campaign',
'params': {'image_alias': 'campaign'}
}
)
) }}
{% endfor %}