templates/includes/title-blocks/title-block.html.twig line 1

Open in your IDE?
  1. {% set suffix = suffix|default('title-block') %}
  2. {% set titleTag = titleTag|default('h2') %}
  3. {% set titleStyle = titleStyle|default('') %}
  4. {% set titlePlaceholder = titlePlaceholder|default('Title') %}
  5. {% set subtitleTag = subtitleTag|default('div') %}
  6. {% set subtitleStyle = subtitleStyle|default('h4') %}
  7. {% set noSubtitleGradient = noSubtitleGradient|default(false) %}
  8. {% set subtitlePlaceholder = subtitlePlaceholder|default('Subtitle') %}
  9. {% set introTag = introTag|default('div') %}
  10. {% set hideIntro = hideIntro|default(false) %}
  11. {% set introStyle = introStyle|default('') %}
  12. {% set introBig = introBig|default(false) %}
  13. {% set introBigStyle = introBigStyle|default('') %}
  14. {% set seodescription = seodescription | default('') %}
  15. {% set isBig = isBig|default(false) %}
  16. {% set breakTitle = pimcore_checkbox('breakTitle').checked|default(false) %}
  17. {% set className = className|default('') %}
  18. <div class="title-block {{ className }} {{ titleTag == 'h1' ? 'title-block--main' }} {{ isBig ? 'title-block--big' }}">
  19.     {% if editmode and not isBig %}
  20.         <div class="editmode-box editmode-box--info mb-2 d-inline-block">
  21.             {{ pimcore_checkbox('breakTitle', {
  22.                 label: 'Break title'
  23.             }) }}
  24.         </div>
  25.     {% endif %}
  26.     {% if editmode or not pimcore_input('subtitle' ~ suffix).isEmpty() %}
  27.         <{{ subtitleTag }} class="title-block__sub-title h4 {{ subtitleStyle }} {{ not noSubtitleGradient ? 'text-gradient-primary' }}">
  28.             {{ pimcore_input('subtitle' ~ suffix, {
  29.                 placeholder: subtitlePlaceholder
  30.             }) }}
  31.         </{{ subtitleTag }}>
  32.     {% endif %}
  33.     {% if editmode or not pimcore_input('title' ~ suffix).isEmpty() or not pimcore_input('titleBold' ~ suffix).isEmpty() %}
  34.         <{{ titleTag }} class="title-block__title js-toc__title {{ titleStyle }}" tabindex="-1">
  35.             {% if editmode or not pimcore_input('titleBold' ~ suffix).isEmpty() %}
  36.                 <strong class="title-block__title--bold">
  37.                     {{ pimcore_input('titleBold' ~ suffix, {
  38.                         placeholder: titleTag == 'h1' ? titlePlaceholder ~ ' (H1)' : titlePlaceholder
  39.                     }) }}
  40.                 </strong>
  41.                 {% if breakTitle %}
  42.                     <br>
  43.                 {% endif %}
  44.             {% endif %}
  45.             {% if editmode or not pimcore_input('title' ~ suffix).isEmpty() %}
  46.                 {{ pimcore_input('title' ~ suffix, {
  47.                     placeholder: titleTag == 'h1' ? titlePlaceholder ~ ' (H1)' : titlePlaceholder
  48.                 }) }}
  49.             {% endif %}
  50.         </{{ titleTag }}>
  51.     {% endif %}
  52.     {% if not pimcore_input('titleBold' ~ suffix).isEmpty() or not pimcore_input('title' ~ suffix).isEmpty() %}
  53.         {% do elements_head_title(pimcore_input('titleBold' ~ suffix) ~ ' ' ~ pimcore_input('title' ~ suffix)) %}
  54.     {% endif %}
  55.     {% if not hideIntro and (editmode or not pimcore_wysiwyg('intro' ~ suffix).isEmpty()) %}
  56.         {% if introBig %}
  57.             <div class="title-block__description--big {{ introBigStyle }}">
  58.                 {{ pimcore_wysiwyg('introBig' ~ suffix)|raw }}
  59.             </div>
  60.         {% endif %}
  61.         <{{ introTag }} class="title-block__description wysiwyg {{ introStyle }}">
  62.             {{ pimcore_wysiwyg('intro' ~ suffix)|raw }}
  63.         </{{ introTag }}>
  64.     {% endif %}
  65.     {% if seodescription is not defined or seodescription %}
  66.         {% do elements_head_meta(pimcore_wysiwyg('intro' ~ suffix), true) %}
  67.     {% endif %}
  68. </div>