templates/network/profile/components/hero.html.twig line 1

Open in your IDE?
  1. {% if editmode %}
  2.   {{
  3.     pimcore_select(
  4.       'colorFilter',
  5.       {
  6.         reload: true,
  7.         store: [
  8.           ['', 'kein'],
  9.           ['gold', 'gold'],
  10.           ['braun', 'braun'],
  11.           ['hellgrau', 'hellgrau'],
  12.           ['dunkelgrau', 'dunkelgrau']
  13.         ]
  14.       }
  15.     )
  16.   }}
  17. {% endif %}
  18. {% if editmode or pimcore_image('background').image or pimcore_input('title').text %}
  19.   <section>
  20.     {% set bgImageStyle = '' %}
  21.     {% set bgFilter = 'bg-neutral-900' %}
  22.     {% set textSubheadline = 'text-primary' %}
  23.     {% set textHeadline = 'text-white' %}
  24.     {% set btnClass = 'btn btn-primary' %}
  25.     {% if pimcore_select('colorFilter').getData() == 'gold' %}
  26.       {% set bgImageStyle = 'filter: grayscale(100%);' %}
  27.       {% set textSubheadline = 'text-black' %}
  28.       {% set textHeadline = 'text-white' %}
  29.       {% set btnClass = 'btn btn-black' %}
  30.       {% set bgFilter = 'bg-primary' %}
  31.     {% elseif pimcore_select('colorFilter').getData() == 'braun' %}
  32.       {% set bgImageStyle = 'filter: grayscale(100%);' %}
  33.       {% set bgFilter = ' bg-secondary' %}
  34.       {% set textSubheadline = 'text-white' %}
  35.       {% set textHeadline = 'text-white' %}
  36.       {% set btnClass = 'btn btn-primary' %}
  37.     {% elseif pimcore_select('colorFilter').getData() == 'hellgrau' %}
  38.       {% set bgImageStyle = 'filter: grayscale(100%);' %}
  39.       {% set bgFilter = ' bg-background' %}
  40.       {% set textSubheadline = 'text-black' %}
  41.       {% set textHeadline = 'text-black' %}
  42.       {% set btnClass = 'btn btn-black' %}
  43.     {% elseif pimcore_select('colorFilter').getData() == 'dunkelgrau' %}
  44.       {% set bgImageStyle = 'filter: grayscale(100%);' %}
  45.       {% set bgFilter = 'bg-neutral-900' %}
  46.       {% set btnClass = 'btn btn-primary' %}
  47.       {% set textSubheadline = 'text-primary' %}
  48.       {% set textHeadline = 'text-white' %}
  49.       {% set btnClass = ' btn btn-primary' %}
  50.     {% endif %}
  51.     <div class="relative grid w-full bg-center bg-contain md:py-0">
  52.       <div class="grid lg:items-center lg:grid-cols-2">
  53.         <div class="z-30 grid px-2 py-8 flex-grow-1 lg:py-20 lg:px-10 lg:py-40 place-content-center">
  54.           <div class="grid justify-center gap-4 md:gap-12">
  55.             <h2 class="m-0 font-light text-center uppercase {{ textSubheadline }} h4 text-shadow">
  56.               {{ pimcore_input('subtitle', { placeholder: 'subheadline' }) }}
  57.             </h2>
  58.             <h1 class="px-4 m-0 text-3xl lg:text-5xl font-medium text-center {{
  59.               textHeadline
  60.               }} normal-case h1 font-headline text-shadow">
  61.               {{ pimcore_input('title', { placeholder: 'headline' }) }}
  62.             </h1>
  63.             {% if editmode or pimcore_link('link') %}
  64.               <div class="mx-auto">
  65.                 {{ pimcore_link('link', { class: 'mx-auto ' ~ btnClass }) }}
  66.               </div>
  67.             {% endif %}
  68.           </div>
  69.         </div>
  70.         <div class="z-30 h-full">
  71.           {% if not editmode and pimcore_image('background').image %}
  72.             {% set image = pimcore_image('background').getThumbnail('hero-background') %}
  73.             {{
  74.               image.html({
  75.                 pictureAttributes: { class: 'object-contain h-full' },
  76.                 imgAttributes: { class: 'object-contain h-full' }
  77.               })|raw
  78.             }}
  79.           {% endif %}
  80.           {% if editmode %}
  81.             {{
  82.               pimcore_image(
  83.                 'background',
  84.                 { thumbnail: 'hero-background', class: 'w-full', height: 500 }
  85.               )
  86.             }}
  87.           {% endif %}
  88.         </div>
  89.       </div>
  90.       <div class="absolute top-0 left-0 w-full h-full z-10 {{ bgFilter }}"></div>
  91.     </div>
  92.   </section>
  93. {% endif %}