templates/bundles/ProviderBundle/areas/headline/view.html.twig line 1

Open in your IDE?
  1. {% from '@Provider/macros/include-svg.html.twig' import includeSvg %}
  2. {# Default block settings #}
  3. {% set class = pimcore_input('class').getData() %}
  4. {% set marginTop = pimcore_select('margin_top').getData() %}
  5. {% set marginBottom = pimcore_select('margin_bottom').getData() %}
  6. {% set containerWidth = pimcore_select('container_width').getData() %}
  7. {% set areaClass = class ~ ' ' ~ marginTop ~ ' ' ~ marginBottom ~ ' ' ~ containerWidth %}
  8. {% set anchorId = pimcore_input('anchor').getData() %}
  9. {# Headline block settings #}
  10. {% set align = pimcore_select('align').getData() %}
  11. {% set wrapInSpan = pimcore_checkbox('wrap_in_span').isChecked() %}
  12. {% set size = pimcore_select('size').getData() %}
  13. {% set styleSize = pimcore_select('style_size').getData() %}
  14. {% set headlineAnchor = pimcore_link('headline_anchor') %}
  15. {% if not headlineAnchor.isEmpty() %}
  16.     {% set areaClass = areaClass ~ ' ' ~ 'has-btn' %}
  17. {% endif %}
  18. {% if size is empty %}
  19.     {% set size = 'h2' %}
  20. {% endif %}
  21. {#% set icon = pimcore_select('icon').getData() %#}
  22. {% if styleSize is empty %}
  23.     {# No special size class #}
  24.     {% set elementClass = '' %}
  25.     {% set sizeClass = size %}
  26. {% else %}
  27.     {# Custom size class #}
  28.     {% set elementClass = styleSize %}
  29.     {% set sizeClass = styleSize %}
  30. {% endif %}
  31. {% set special = pimcore_checkbox('special').isChecked() ? true : false %}
  32. {% if special %}
  33.     {% set elementClass = elementClass ~ ' ' ~ 'special' %}
  34. {% endif %}
  35. <div class="area area--header area--header-{{ sizeClass }} {{ areaClass }} {{ align }}"{% if anchorId %} id="{{ anchorId }}"{% endif %}>
  36. {#  {{ pimcore_wysiwyg('hea', {
  37.         "settings": {
  38.             "formats": {
  39.                 "normal": {"block": 'h2'}
  40.             }
  41.         },
  42.         "placeholder": "Test",
  43.         "format_tags": "h1;h2;h3;h4;h5;h6",
  44.         "toolbarGroups": [
  45.             {
  46.                 "name": 'styles',
  47.                 "groups": [ 'styles', 'align']
  48.             }
  49.         ],
  50.         "stylesSet": [
  51.             {
  52.                 "name": "Fake H1",
  53.                 "element": ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
  54.                 "attributes": { "class": "h1" }
  55.             },
  56.             {
  57.                 "name": "Fake H2",
  58.                 "element": ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
  59.                 "attributes": { "class": "h2" }
  60.             },
  61.             {
  62.                 "name": "Fake H3",
  63.                 "element": ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
  64.                 "attributes": { "class": "h3" }
  65.             },
  66.             {
  67.                 "name": "Fake H4",
  68.                 "element": ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
  69.                 "attributes": { "class": "h4" }
  70.             },
  71.             {
  72.                 "name": "Fake H5",
  73.                 "element": ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
  74.                 "attributes": { "class": "h5" }
  75.             },
  76.             {
  77.                 "name": "Fake H6",
  78.                 "element": ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
  79.                 "attributes": { "class": "h6" }
  80.             }
  81.         ]
  82.     }) }}#}
  83.     <{{ size }} class="{{ elementClass }}">
  84.         {% if wrapInSpan %}<span>{% endif %}{{ pimcore_input('headline', {'placeholder': 'Überschrift'}) }}{% if wrapInSpan %}</span>{% endif %}
  85.         {% if special %}<span class="spacer">{{ includeSvg('diverses/diamond') }}</span>{% endif %}
  86.         {% if editmode or not pimcore_input('subline').isEmpty() %}
  87.             <small>{{ pimcore_input('subline', {
  88.                     'placeholder': 'Subline'
  89.                 }) }}</small>
  90.         {% endif %}
  91.     </{{ size }}>
  92.     {% if not headlineAnchor.isEmpty() %}
  93.         <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>
  94.     {% endif %}
  95. </div>