{% from '@Provider/macros/include-svg.html.twig' import includeSvg %}
{# Default block settings #}
{% set class = pimcore_input('class').getData() %}
{% set marginTop = pimcore_select('margin_top').getData() %}
{% set marginBottom = pimcore_select('margin_bottom').getData() %}
{% set containerWidth = pimcore_select('container_width').getData() %}
{% set areaClass = class ~ ' ' ~ marginTop ~ ' ' ~ marginBottom ~ ' ' ~ containerWidth %}
{% set anchorId = pimcore_input('anchor').getData() %}
{# Headline block settings #}
{% set align = pimcore_select('align').getData() %}
{% set wrapInSpan = pimcore_checkbox('wrap_in_span').isChecked() %}
{% set size = pimcore_select('size').getData() %}
{% set styleSize = pimcore_select('style_size').getData() %}
{% set headlineAnchor = pimcore_link('headline_anchor') %}
{% if not headlineAnchor.isEmpty() %}
{% set areaClass = areaClass ~ ' ' ~ 'has-btn' %}
{% endif %}
{% if size is empty %}
{% set size = 'h2' %}
{% endif %}
{#% set icon = pimcore_select('icon').getData() %#}
{% if styleSize is empty %}
{# No special size class #}
{% set elementClass = '' %}
{% set sizeClass = size %}
{% else %}
{# Custom size class #}
{% set elementClass = styleSize %}
{% set sizeClass = styleSize %}
{% endif %}
{% set special = pimcore_checkbox('special').isChecked() ? true : false %}
{% if special %}
{% set elementClass = elementClass ~ ' ' ~ 'special' %}
{% endif %}
<div class="area area--header area--header-{{ sizeClass }} {{ areaClass }} {{ align }}"{% if anchorId %} id="{{ anchorId }}"{% endif %}>
{# {{ pimcore_wysiwyg('hea', {
"settings": {
"formats": {
"normal": {"block": 'h2'}
}
},
"placeholder": "Test",
"format_tags": "h1;h2;h3;h4;h5;h6",
"toolbarGroups": [
{
"name": 'styles',
"groups": [ 'styles', 'align']
}
],
"stylesSet": [
{
"name": "Fake H1",
"element": ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
"attributes": { "class": "h1" }
},
{
"name": "Fake H2",
"element": ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
"attributes": { "class": "h2" }
},
{
"name": "Fake H3",
"element": ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
"attributes": { "class": "h3" }
},
{
"name": "Fake H4",
"element": ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
"attributes": { "class": "h4" }
},
{
"name": "Fake H5",
"element": ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
"attributes": { "class": "h5" }
},
{
"name": "Fake H6",
"element": ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
"attributes": { "class": "h6" }
}
]
}) }}#}
<{{ size }} class="{{ elementClass }}">
{% if wrapInSpan %}<span>{% endif %}{{ pimcore_input('headline', {'placeholder': 'Überschrift'}) }}{% if wrapInSpan %}</span>{% endif %}
{% if special %}<span class="spacer">{{ includeSvg('diverses/diamond') }}</span>{% endif %}
{% if editmode or not pimcore_input('subline').isEmpty() %}
<small>{{ pimcore_input('subline', {
'placeholder': 'Subline'
}) }}</small>
{% endif %}
</{{ size }}>
{% if not headlineAnchor.isEmpty() %}
<a href="{{ headlineAnchor.getHref() }}" class="btn btn-{% if headlineAnchor.getClass() %}{{ headlineAnchor.getClass() }}{% else %}outline{% endif %}" {% if headlineAnchor.getTarget() %}target="{{ headlineAnchor.getTarget() }}"{% endif %}>{{ headlineAnchor.getText() }}</a>
{% endif %}
</div>