templates/Form/contact.html.twig line 1

Open in your IDE?
  1. {% extends "Layout/default.html.twig" %}
  2. {#{% do pimcore_placeholder('add-hashcash-script').set(true) %}#}
  3. {% block content %}
  4.     {{ include('Content/includes/hero.html.twig') }}
  5.     {{ include('Navigation/breadcrumb.html.twig') }}
  6.     {{ include('Includes/main-title-block-splitted-editable.html.twig') }}
  7.     {{ include('Includes/areablock.html.twig') }}
  8.     {% if editmode %}
  9.         <div class="editmode-box editmode-box--info">
  10.             <div class="editmode-box__header">
  11.                 Settings
  12.             </div>
  13.             <div class="alert alert-info">
  14.                 if no region select in use. The region found in properties will be used to determine the correct email address
  15.             </div>
  16.             <div class="row">
  17.                 <div class="col-6">
  18.                     <label>
  19.                         Topics: <br>
  20.                         {{ pimcore_relations('topics', {'types': ['object'], 'subtypes': ['object'], 'classes': ['ContactTopic'], width: 600}) }}
  21.                     </label>
  22.                 </div>
  23.                 <div class="col-6">
  24.                     <label>
  25.                         Regions: <br>
  26.                         {{ pimcore_relations('regions', {'types': ['object'], 'subtypes': ['object'], 'classes': ['Region'], width: 600}) }}
  27.                     </label>
  28.                 </div>
  29.                 <div class="col-6">
  30.                     <label>
  31.                         Preselect Topic: <br>
  32.                         {{ pimcore_relation('topic', {'types': ['object'], 'subtypes': ['object'], 'classes': ['ContactTopic'], width: 600}) }}
  33.                     </label>
  34.                 </div>
  35.                 <div class="col-6">
  36.                     <label>
  37.                         Preselect Region: <br>
  38.                         {{ pimcore_relation('region', {'types': ['object'], 'subtypes': ['object'], 'classes': ['Region'], width: 600}) }}
  39.                     </label>
  40.                 </div>
  41.             </div>
  42.             Success Page:
  43.             <br>
  44.             {{ pimcore_relation('success', {'types': ['document'], 'subtypes': ['page']}) }}
  45.             <br>
  46.             Email Document:
  47.             <br>
  48.             {{ pimcore_relation('email', {'types': ['document'], 'subtypes': ['email']}) }}
  49.             <br>
  50.             Use company instead of title: {{ pimcore_checkbox('use_company', {reload:true}) }}
  51.         </div>
  52.     {% endif %}
  53.     <section class="slide content-block bg-secondary">
  54.         <div class="container">
  55.             {{ include('Includes/title-block-editable.html.twig', {'isWhite': true, 'isCentered': true, 'suffix': 'contact-'}) }}
  56.         </div>
  57.         {% do jsConfig().add({
  58.             'recaptchaPublicKey': recaptchaExtension().publicKey,
  59.             'recaptcha': true
  60.         }) %}
  61.         <div class="container container-narrow">
  62.             {% if errors |default(false) %}
  63.                 <div class="alert alert-danger">
  64.                     <ul>
  65.                         {% for error in errors %}
  66.                             <li>{{ ('contact.error.'~ error)|trans }}</li>
  67.                         {% endfor %}
  68.                     </ul>
  69.                 </div>
  70.             {% endif %}
  71.             <form action="{{ app.request.pathInfo }}" class="js-elhc-form js-elhc-form-ajax js-form-validation" method="POST">
  72.                 <div hidden>
  73.                     {{ include('Form/Includes/form-control.html.twig', {
  74.                         name: 'potNumber',
  75.                         id: 'potNumber',
  76.                         value: ''
  77.                     }) }}
  78.                 </div>
  79.                 <div class="row">
  80.                     {% if not pimcore_relations('topics').empty %}
  81.                         <div class="col-md-6">
  82.                             {% set default = [{
  83.                                 "label": "",
  84.                                 "value": "",
  85.                                 "disabled": true,
  86.                                 "selected": true,
  87.                                 "class": "sr-only"
  88.                             }] %}
  89.                             {{ include('Form/Includes/select.html.twig', {
  90.                                 id: 'topic-select',
  91.                                 inputModifier: "js-floating-label",
  92.                                 labelModifier: "floating-label",
  93.                                 inputWrapperModifier: "select__input-wrapper position-relative",
  94.                                 name: "topic",
  95.                                 required: true,
  96.                                 label: 'contact.Thema auswählen'|trans,
  97.                                 options: default|merge(pimcore_relations('topics').elements | map( x => {
  98.                                     "label": x.name,
  99.                                     "value": x.id,
  100.                                     "class": ""
  101.                                 })),
  102.                                 errors: errors['topic'] is defined ? [errors['topic']] : null
  103.                             }) }}
  104.                         </div>
  105.                     {% endif %}
  106.                     {% if not pimcore_relations('regions').empty %}
  107.                         <div class="col-md-6">
  108.                             {% set default = [{
  109.                                 "label": "",
  110.                                 "value": "",
  111.                                 "disabled": true,
  112.                                 "selected": true,
  113.                                 "class": "sr-only"
  114.                             }] %}
  115.                             {{ include('Form/Includes/select.html.twig', {
  116.                                 id: 'region-select',
  117.                                 inputModifier: "js-floating-label",
  118.                                 labelModifier: "floating-label",
  119.                                 inputWrapperModifier: "select__input-wrapper position-relative",
  120.                                 name: "region",
  121.                                 required: true,
  122.                                 label: 'contact.Region auswählen'|trans,
  123.                                 options: default|merge(pimcore_relations('regions').elements | map( x => {
  124.                                     "label": x.name,
  125.                                     "value": x.id,
  126.                                     "class": ""
  127.                                 })),
  128.                                 errors: errors['region'] is defined ? [errors['region']] : null
  129.                             }) }}
  130.                         </div>
  131.                     {% endif %}
  132.                 </div>
  133.                 <div class="row">
  134.                             <div class="col-md-6">
  135.                         {{ include('Form/Includes/select.html.twig', {
  136.                             id: 'salutation',
  137.                             inputModifier: "js-floating-label",
  138.                             labelModifier: "floating-label",
  139.                             inputWrapperModifier: "select__input-wrapper position-relative",
  140.                             name: "salutation",
  141.                             required: true,
  142.                             label: 'contact.Anrede'|trans,
  143.                             styleModifier: 'form-group--sm',
  144.                             options: [
  145.                                 {
  146.                                     "label": "",
  147.                                     "value": "",
  148.                                     "disabled": true,
  149.                                     "selected": true,
  150.                                     "class": "sr-only"
  151.                                 }, {
  152.                                     "label": 'newsletter.Frau'|trans,
  153.                                     "value": 'female',
  154.                                     "class": '',
  155.                                 }, {
  156.                                     "label": 'newsletter.Herr'|trans,
  157.                                     "value": 'male',
  158.                                     "class": ""
  159.                                 }, {
  160.                                     "label": 'newsletter.Familie/Firma'|trans,
  161.                                     "value": 'other',
  162.                                     "class": ""
  163.                                 },],
  164.                             errors: errors['salutation'] is defined ? [errors['salutation']] : null,
  165.                         }) }}
  166.                     </div>
  167.                     <div class="col-md-6">
  168.                         {% if pimcore_checkbox('use_company').checked %}
  169.                             {{ include('Form/Includes/form-control.html.twig', {
  170.                                 id: 'company',
  171.                                 name: 'company',
  172.                                 inputModifier: 'js-floating-label',
  173.                                 inputWrapperModifier: 'position-relative',
  174.                                 labelModifier: 'floating-label',
  175.                                 label: 'contact.Company'|trans
  176.                             }) }}
  177.                         {% else %}
  178.                             {{ include('Form/Includes/form-control.html.twig', {
  179.                                 id: 'title',
  180.                                 name: 'title',
  181.                                 inputModifier: 'js-floating-label',
  182.                                 inputWrapperModifier: 'position-relative',
  183.                                 labelModifier: 'floating-label',
  184.                                 label: 'contact.Titel'|trans
  185.                             }) }}
  186.                         {% endif %}
  187.                     </div>
  188.                     <div class="col-md-6">
  189.                         {{ include('Form/Includes/form-control.html.twig', {
  190.                             id: 'firstname',
  191.                             name: 'firstname',
  192.                             inputModifier: 'js-floating-label',
  193.                             inputWrapperModifier: 'position-relative',
  194.                             labelModifier: 'floating-label',
  195.                             label: 'contact.Vorname'|trans,
  196.                             required: true,
  197.                             errors: errors['firstname'] is defined ? [errors['firstname']] : null
  198.                         }) }}
  199.                     </div>
  200.                     <div class="col-md-6">
  201.                         {{ include('Form/Includes/form-control.html.twig', {
  202.                             id: 'lastname',
  203.                             name: 'lastname',
  204.                             inputModifier: 'js-floating-label',
  205.                             inputWrapperModifier: 'position-relative',
  206.                             labelModifier: 'floating-label',
  207.                             label: 'contact.Nachname'|trans,
  208.                             required: true,
  209.                             errors: errors['lastname'] is defined ? [errors['lastname']] : null
  210.                         }) }}
  211.                     </div>
  212.                     <div class="col-md-6">
  213.                         {{ include('Form/Includes/form-control.html.twig', {
  214.                             id: 'phone',
  215.                             name: 'phone',
  216.                             inputModifier: 'js-floating-label',
  217.                             inputWrapperModifier: 'position-relative',
  218.                             labelModifier: 'floating-label',
  219.                             label: 'contact.Telefon'|trans,
  220.                             type: 'tel'
  221.                         }) }}
  222.                     </div>
  223.                     <div class="col-md-6">
  224.                         {{ include('Form/Includes/form-control.html.twig', {
  225.                             id: 'email',
  226.                             name: 'email',
  227.                             inputModifier: 'js-floating-label',
  228.                             inputWrapperModifier: 'position-relative',
  229.                             labelModifier: 'floating-label',
  230.                             label: 'contact.E-Mail'|trans,
  231.                             type: 'email',
  232.                             required: true,
  233.                             errors: errors['email'] is defined ? [errors['email']] : null
  234.                         }) }}
  235.                     </div>
  236.                     <div class="col-md-6">
  237.                         {{ include('Form/Includes/form-control.html.twig', {
  238.                             id: 'street',
  239.                             name: 'street',
  240.                             inputModifier: 'js-floating-label',
  241.                             inputWrapperModifier: 'position-relative',
  242.                             labelModifier: 'floating-label',
  243.                             label: 'contact.Straße'|trans,
  244.                             type: 'text',
  245.                             required: false,
  246.                             errors: errors['street'] is defined ? [errors['street']] : null
  247.                         }) }}
  248.                     </div>
  249.                     <div class="col-md-6">
  250.                         {{ include('Form/Includes/form-control.html.twig', {
  251.                             id: 'zip',
  252.                             name: 'zip',
  253.                             inputModifier: 'js-floating-label',
  254.                             inputWrapperModifier: 'position-relative',
  255.                             labelModifier: 'floating-label',
  256.                             label: 'contact.PLZ'|trans,
  257.                             type: 'text',
  258.                             required: false,
  259.                             errors: errors['zip'] is defined ? [errors['zip']] : null
  260.                         }) }}
  261.                     </div>
  262.                     <div class="col-md-6">
  263.                         {{ include('Form/Includes/form-control.html.twig', {
  264.                             id: 'city',
  265.                             name: 'city',
  266.                             inputModifier: 'js-floating-label',
  267.                             inputWrapperModifier: 'position-relative',
  268.                             labelModifier: 'floating-label',
  269.                             label: 'contact.Stadt'|trans,
  270.                             type: 'text',
  271.                             required: false,
  272.                             errors: errors['city'] is defined ? [errors['city']] : null
  273.                         }) }}
  274.                     </div>
  275.                     <div class="col-md-6">
  276.                         {{ include('Form/Includes/select.html.twig', {
  277.                             id: 'country',
  278.                             inputModifier: "js-floating-label",
  279.                             labelModifier: "floating-label",
  280.                             inputWrapperModifier: "select__input-wrapper position-relative",
  281.                             name: "country",
  282.                             required: true,
  283.                             label: 'contact.Land'|trans,
  284.                             styleModifier: 'form-group--sm',
  285.                             options: getCountrySelectData(app.request.locale, app.request.get('country', '')),
  286.                             errors: errors['country'] is defined ? [errors['country']] : null,
  287.                         }) }}
  288.                     </div>
  289.                     <div class="col-12">
  290.                         {{ include('Form/Includes/text-area.html.twig', {
  291.                             id: 'message',
  292.                             name: 'message',
  293.                             inputModifier: 'js-floating-label',
  294.                             inputWrapperModifier: 'position-relative',
  295.                             labelModifier: 'floating-label',
  296.                             label: 'contact.Anregungen/Wünsche'|trans,
  297.                             required: true,
  298.                             rows: 5,
  299.                             errors: errors['message'] is defined ? [errors['message']] : null
  300.                         }) }}
  301.                     </div>
  302.                     {% if elements_debug_mode() and siteConfig.id != getMainConfig() %}
  303.                         <div class="col-md-12">
  304.                             {{ include('Form/Includes/checkbox.html.twig', {
  305.                                 id: 'numbirds',
  306.                                 name: 'numbirds',
  307.                                 label: 'footer.newsletter Numbirds'|trans,
  308.                                 required: false,
  309.                                 errors: errors['numbirds'] is defined ? [errors['numbirds']] : null
  310.                             }) }}
  311.                         </div>
  312.                     {% endif %}
  313.                 </div>
  314.                 <div class="text-right small">
  315.                     * {{ 'contact.Pflichtfelder'|trans }}
  316.                 </div>
  317.                 {{ include('Form/Includes/form-control.html.twig', {
  318.                     type: 'hidden',
  319.                     name: 'gdpr-text',
  320.                     id: 'gdpr-text',
  321.                     value: 'contact.Ich stimme den <a href="#">Datenschutzbestimmungen</a> zu.'|trans
  322.                 }) }}
  323.                 <div>{{ 'contact.Ich stimme den <a href="#">Datenschutzbestimmungen</a> zu.'|trans|raw }}</div>
  324.                 <div class="text-center mt-4">
  325.                     <button type="submit" class="btn btn-primary-light">{{ 'contact.Kontaktanfrage senden'|trans }}</button>
  326.                 </div>
  327.             </form>
  328.         </div>
  329.     </section>
  330.     {{ include('Includes/areablock.html.twig', {'areaName': 'bottomContent'}) }}
  331. {% endblock %}