{% if bloc is defined and bloc is not empty %}
{% set theme_path = 'theme/' ~ app.request.server.get('APP_THEME') ~ '/component-blocks/' %}
{% set template_map = {
'template': bloc.template is defined ? bloc.template | raw : null,
'dynamic-block': {
'principal-block': theme_path ~ 'principal-block.html.twig',
'benefits-block': theme_path ~ 'benefits-block.html.twig',
'picto-block': theme_path ~ 'picto-block.html.twig',
},
'bloc-partenaire': theme_path ~ 'partner_block.html.twig',
'block-image': theme_path ~ 'image-block.html.twig',
'block-gallery': theme_path ~ 'gallery-block.html.twig',
'block-text': theme_path ~ 'title-text-block.html.twig',
'block-video': theme_path ~ 'video-block.html.twig',
'block-media-text': theme_path ~ 'media-text-block.html.twig',
'block-tarifs': theme_path ~ 'tarifs-block.html.twig',
'block-onglets': theme_path ~ 'onglets-block.html.twig',
'block-etaps': theme_path ~ 'etaps-block.html.twig',
'block-links': theme_path ~ 'links-block.html.twig',
'block-bandeau': theme_path ~ 'bandeau-block.html.twig',
'dynamic-form': {
'default': 'theme/' ~ app.request.server.get('APP_THEME') ~ '/component-forms/default_form_template.html.twig',
'wizard-form': 'theme/' ~ app.request.server.get('APP_THEME') ~ '/component-forms/default_form_wizard.html.twig',
'contact-form': 'theme/' ~ app.request.server.get('APP_THEME') ~ '/component-forms/contact_form_template.html.twig',
'question-form': 'theme/' ~ app.request.server.get('APP_THEME') ~ '/component-forms/question_form_template.html.twig',
'candidature-form': 'theme/' ~ app.request.server.get('APP_THEME') ~ '/component-forms/candidature_form_template.html.twig',
'encart-contact-form': 'theme/' ~ app.request.server.get('APP_THEME') ~ '/component-forms/encart_contact_form.html.twig',
'avis-form': 'theme/' ~ app.request.server.get('APP_THEME') ~ '/component-forms/avis_form.html.twig',
}
} %}
{% if bloc.type == 'template' and template_map['template'] %}
{{ template_map['template']|raw }}
{% elseif bloc.type == 'dynamic-block' and bloc.data != null %}
{% if template_map['dynamic-block'][bloc.data.alias] is defined %}
{{ include(template_map['dynamic-block'][bloc.data.alias], { bloc: bloc.data }, with_context = false) }}
{% endif %}
{% elseif template_map[bloc.type] is defined %}
{% if bloc.type == 'dynamic-form' %}
{% if template_map['dynamic-form'][bloc.form.identifier] is defined %}
{{ include(template_map['dynamic-form'][bloc.form.identifier], { bloc: bloc }, with_context = false) }}
{% else %}
{{ include(template_map['dynamic-form']['default'], { bloc: bloc }, with_context = false) }}
{% endif %}
{% else %}
{{ include(template_map[bloc.type], { bloc: bloc }, with_context = false) }}
{% endif %}
{% endif %}
{% endif %}