templates/includes/partials/_button.html.twig line 1

Open in your IDE?
  1. {% if (defaultLink ?? null) %}
  2.     <a
  3.         href="{{ defaultLink.link | trimUrl }}"
  4.         target="{{ defaultLink.target ?: '_self' }}"
  5.         class="{{ buttonClass ?? 'button' }}"
  6.     >
  7.         {{ (textPrefix ?? null)|raw }}{{ defaultLink.title }}{{ (textSuffix ?? null)|raw }}
  8.     </a>
  9. {# If a product or productCategory is passed, show the open-form button instead of a customisable button. #}
  10. {% elseif (product ?? null) or (productCategory ?? null) or (showRentalFormButton ?? null) or (not editmode and 'is-modal' in pimcore_link(fieldName ?? 'link').class) %}
  11.     {% if greenButton %}
  12.         {% set buttonSlot %}
  13.             <div class="relative">
  14.                 <button 
  15.                     @click="props.toggleModal" 
  16.                     class="button {{ showRentalFormButtonColor === 'gray' ? 'button__primary' : 'button__green' }}"
  17.                     data-track-button-id="conversion_requestquote"
  18.                 >
  19.                     {{ 'Offerte aanvragen'|trans }}
  20.                 </button>
  21.                 {% if showCustomButtonComment %}
  22.                     <div class="flex items-start justify-center my-2 ml-2 text-xs md:ml-0 md:my-0 md:left-0 md:absolute text-blue whitespace-nowrap md:-bottom-8 mb-8">
  23.                         <span class="hidden md:absolute md:block -top-10 -left-10">
  24.                             <svg width="47" height="54" xmlns="http://www.w3.org/2000/svg"><defs><clipPath id="1234"><path d="M7.553.59c.269.47.067 1.076-.471 1.345a83.87 83.87 0 0 1-2.423 1.077c11.135.712 19.956 7.124 22.808 16.82 2.893 9.89-1.346 19.847-11.169 26.037a.765.765 0 0 1-.538.201c-.336 0-.672-.135-.874-.471-.27-.471-.135-1.077.336-1.413 9.015-5.72 12.985-14.802 10.361-23.75-2.605-8.895-10.792-14.79-21.16-15.417.914.72 1.813 1.58 2.457 2.77.27.47.135 1.076-.404 1.345-.135.268-.336.268-.471.268-.336 0-.673-.202-.875-.538-.74-1.278-1.75-2.085-2.892-2.893C1.565 5.433.892 4.962.287 4.29a.995.995 0 0 1-.27-.875c.068-.336.27-.606.539-.74 1.009-.471 1.95-.875 2.892-1.278C4.39.993 5.332.59 6.207.119c.47-.27 1.077-.068 1.346.47Z"/></clipPath><clipPath id="4567"><path d="M28.36 0v46.07H0V0h28.36Z"/></clipPath></defs><g clip-path="url(#1234)" transform="scale(-1 1) rotate(26 -13.163 -55.877)"><g clip-path="url(#4567)"><path fill="#0071BB" d="M0 0h28.36v46.07H0V0z"/></g></g></svg>
  25.                         </span>   
  26.                         <span class="md:hidden">
  27.                             <svg width="22" height="20" xmlns="http://www.w3.org/2000/svg"><defs><clipPath id="107118525210612011410197100"><path d="M12.01 0v18.086H0V0h12.01Z"/></clipPath><clipPath id="53121112112521191031055798"><path d="M11.341 0c.201.002.4.104.54.286a.664.664 0 0 1 .094.604c-.166.581-.432 1.06-.679 1.58-.449.82-.819 1.6-.889 2.583a.724.724 0 0 1-.285.53l-.082.05c-.081.039-.202.098-.362-.023a.633.633 0 0 1-.636-.69c.039-.902.327-1.682.664-2.38C3.883 5.828.71 11.463 1.425 17.332a.66.66 0 1 1-1.309.185c-.802-6.418 2.6-12.55 8.86-16.115-.57.028-1.148.053-1.768.063-.401-.004-.7-.308-.677-.67.004-.401.309-.7.67-.676.663.027 1.346-.007 2.03-.04a64.742 64.742 0 0 1 2.11-.08Z"/></clipPath><clipPath id="5353105120011210011111656"><path d="M12.01 0v18.086H0V0h12.01Z"/></clipPath></defs><g clip-path="url(#107118525210612011410197100)" transform="rotate(-57 9.275 5.036)"><g clip-path="url(#53121112112521191031055798)"><g clip-path="url(#5353105120011210011111656)"><path fill="#0071BA" d="M0 0h12.009v18.086H0V0z"/></g></g></g></svg>
  28.                         </span>
  29.                         <span class="py-2 md:py-0">{{ buttonComment }}</span>
  30.                     </div>
  31.                 {% endif %}
  32.             </div>
  33.         {% endset %}
  34.         <div class="inline">
  35.             {% include 'includes/partials/_rental-form.html.twig' with {
  36.                 buttonText: pimcore_link(fieldName ?? "link").text,
  37.                 buttonSlot: buttonSlot,
  38.                 requestUrl: data.request.url ?? null
  39.             } %}
  40.         </div>
  41.     {% else %}
  42.         <div class="inline">
  43.             {% include 'includes/partials/_rental-form.html.twig' with {
  44.                 buttonText: pimcore_link(fieldName ?? "link").text,
  45.                 requestUrl: data.request.url ?? null
  46.             } %}
  47.         </div>
  48.     {% endif %}
  49. {% else %}
  50.     {{ pimcore_link(fieldName ?? 'link', {
  51.         class: buttonClass ?? 'button',
  52.         textPrefix: textPrefix ?? null,
  53.         textSuffix: textSuffix ?? null,
  54.     }) }}
  55. {% endif %}