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

Open in your IDE?
  1. {% set prefix = prefix is defined ? prefix ~ '-' : '' %}
  2. {% set titleTag = titleTag | default('h2') %}
  3. {% set titleStyle = titleStyle | default('') %}
  4. {% set subtitleTag = subtitleTag | default('h3') %}
  5. {% set subtitleStyle = subtitleStyle | default('') %}
  6. {% if disableTagAndStyleEditables|default(false) %}
  7. {# hide editbox => do not completly remove the editbox, cause we use the editables for the html tags#}
  8.     <div hidden>
  9. {% endif %}
  10.     {% embed 'global/editmode-settings.html.twig' %}
  11.         {% block additionalInfo %}
  12.             <div>
  13.                 <label>
  14.                     Title tag: {{ pimcore_select(prefix ~ 'title-tag', {
  15.                         store: [
  16.                             ["h1", "h1"],
  17.                             ["h2", "h2"],
  18.                             ["h3", "h3"],
  19.                             ["h4", "h4"],
  20.                             ["h5", "h5"],
  21.                         ],
  22.                         defaultValue: titleTag
  23.                     }) }}
  24.                 </label>
  25.                 <label class="ml-2">
  26.                     Title tag style: {{ pimcore_select(prefix ~ 'title-style', {
  27.                         store: [
  28.                             ["", "No style"],
  29.                             ["h1", "h1"],
  30.                             ["h2", "h2"],
  31.                             ["h3", "h3"],
  32.                             ["h4", "h4"],
  33.                             ["h5", "h5"],
  34.                         ],
  35.                         defaultValue: titleStyle,
  36.                         reload: true
  37.                     }) }}
  38.                 </label>
  39.             </div>
  40.             <div>
  41.                 <label>
  42.                     Subtitle tag: {{ pimcore_select(prefix ~ 'subtitle-tag', {
  43.                         store: [
  44.                             ["h2", "h2"],
  45.                             ["h3", "h3"],
  46.                             ["h4", "h4"],
  47.                             ["h5", "h5"],
  48.                         ],
  49.                         defaultValue: subtitleTag
  50.                     }) }}
  51.                 </label>
  52.                 <label class="ml-2">
  53.                     Subtitle tag style: {{ pimcore_select(prefix ~ 'subtitle-style', {
  54.                         store: [
  55.                             ["", "No style"],
  56.                             ["h1", "h1"],
  57.                             ["h2", "h2"],
  58.                             ["h3", "h3"],
  59.                             ["h4", "h4"],
  60.                             ["h5", "h5"],
  61.                         ],
  62.                         defaultValue: subtitleStyle,
  63.                         reload: true
  64.                     }) }}
  65.                 </label>
  66.             </div>
  67.         {% endblock %}
  68.     {% endembed %}
  69. {% if disableTagAndStyleEditables|default(false) %}
  70.     </div>
  71. {% endif %}
  72. {% if not pimcore_input(prefix ~ 'title-block-title').empty or not pimcore_input(prefix ~ 'title-block-subtitle').empty or editmode %}
  73. <div class="title-block {{ className | default('') }}">
  74.     {% if editmode or not pimcore_input(prefix ~ 'title-block-title').empty %}
  75.         <{{ pimcore_select(prefix ~ 'title-tag').data }} class="title-block__title js-toc__title {{ pimcore_select(prefix ~ 'title-style').data }}">{{ pimcore_input(prefix ~ 'title-block-title', { placeholder: "Title" }) }}</{{ pimcore_select(prefix ~ 'title-tag').data }}>
  76.         {% if pimcore_select(prefix ~ 'title-tag').data == "h1" and not pimcore_input(prefix ~ 'title-block-title').empty %}
  77.             {% do elements_head_title(pimcore_input(prefix ~ 'title-block-title').data) %}
  78.         {% endif %}
  79.     {% endif %}
  80.     {% if editmode or not pimcore_input(prefix ~ 'title-block-subtitle').empty  %}
  81.         <{{ pimcore_select(prefix ~ 'subtitle-tag').data }} class="title-block__sub-title {{ pimcore_select(prefix ~ 'subtitle-style').data }}">{{ pimcore_input(prefix ~ 'title-block-subtitle', { placeholder: "Subtitle" }) }}</{{ pimcore_select(prefix ~ 'subtitle-tag').data }}>
  82.     {% endif %}
  83.     {% if editmode or not pimcore_wysiwyg(prefix ~ 'title-block-wysiwyg').empty  %}
  84.         <div class="wysiwyg">
  85.             {{ pimcore_wysiwyg(prefix ~ 'title-block-wysiwyg') }}
  86.         </div>
  87.     {% endif %}
  88. </div>
  89. {% endif %}