templates/content/landing-page.html.twig line 1

Open in your IDE?
  1. {% extends "base.html.twig" %}
  2. {# empty elements #}
  3. {% block header %}{% endblock %}
  4. {% block toolbar %}{% endblock %}
  5. {% block footer %}{% endblock %}
  6. {% block bottom %}{% endblock %}
  7. {% block body %}
  8.     <script>
  9.     {# Quick fix to double scrollbar issue #}
  10.     document.documentElement.setAttribute("style", "overflow: visible;");
  11.     </script>
  12.     {# Render the appropriate template file. #}
  13.     {# adjusting so all landing pages are 1 template type ... 1 column full #}
  14.     {% if true or page.template == 1 %}
  15.         {# <div class="container-fluid"> #}
  16.         
  17.         {% set background = page.getContentMetaValueByKey("rcs_body_background_color") %}
  18.         {% if background %}
  19.             <style>
  20.                 .top-wrap {
  21.                     display: table;
  22.                 }
  23.             </style>
  24.             <div class="lp-wrapper" style="background: {{ background }}; padding-top: 15px; padding-bottom: 15px; min-height: 100vh; display: block;">
  25.         {% endif %}
  26.         
  27.         <div class="container" style="background: #fff; max-width: 800px;">
  28.         
  29.         <style>
  30.             {# hack ... can't think of a better way right now... #}
  31.             .top-wrap:after {
  32.                 height: 0;
  33.             }
  34.         </style>
  35.         
  36.             {% if message is defined %}
  37.                 <div class="row mt-3">
  38.                     <div class="col-sm-12">
  39.                         <div class="alert alert-{{ message.type }}">
  40.                             {{ message.text }}
  41.                         </div>
  42.                     </div>
  43.                 </div>
  44.             {% endif %}
  45.         
  46.             <div class="row">
  47.                 <div class="col-sm-12">
  48.                 
  49.                 {#
  50.                 {% if page.hasContent() %}
  51.                     {{ page.getContentFull() | raw }}
  52.                 #}
  53.                 
  54.                 {# Only do this if landing page uses the new admin interface #}
  55.                 {% if page.isNewLandingPage() %}
  56.                     
  57.                     {# display the landing page #}
  58.                     <div class="row">
  59.                         <div class="col-sm-12">
  60.                             
  61.                             {# Header #}
  62.                             <div class="row" style="min-height: 10px;">
  63.                                 <div class="col-sm-12" style="background: {{page.getLPHeaderColor()}};">
  64.                                     {% set hide_alert_block = true %}
  65.                                     {% include "includes/messages.html.twig" %}
  66.                                     {{ page.getLPHeader()|raw }}
  67.                                 </div>
  68.                             </div>
  69.                             
  70.                             {# Body #}
  71.                             <div class="row">
  72.                                 {# Left Column #}
  73.                                 <div class="col-md-6 p-3" style="background: {{page.getLPLeftColor()}};">
  74.                                     {{ page.getLPLeft()|raw }}
  75.                                     
  76.                                     {# Form #}
  77.                                     {% set buttonColor = (page.getContentMetaValueByKey("btn_color") ? page.getContentMetaValueByKey("btn_color") : "#A41822") %}
  78.                                     {% set buttonText = (page.getContentMetaValueByKey("btn_text") ? page.getContentMetaValueByKey("btn_text") : "Submit") %}
  79.                                     
  80.                                     {# Use the form object if it's set #}
  81.                                     {% set form = page.getForm() %}
  82.                                     {% if form %}
  83.                                         <form method="post" class="py-4" enctype="multipart/form-data">
  84.                                             {% for field in  form.getFormFields() %}
  85.                                                 
  86.                                                 <label class="btn-block custom-frm-label">
  87.                                                     {% if field.getDescription() %}
  88.                                                         <span class="rtooltip">{{field.getTitle()}} <i class="fa fa-question-circle"></i>:
  89.                                                             <div class="rtooltiptext" style="">
  90.                                                                 {{field.getDescription()}}
  91.                                                                 {#RoofersCoffeeShop offers users the ability to post messages, submit information, and upload images to be used on this site.   This information is shared with advertisers and partners associated with RoofersCoffeeShop.  
  92.                                                                 <br><br>
  93.                                                                 You acknowledge that you have permission related to Content, Information, and Images submitted and that they do not violate any copyright laws or privacy.   
  94.                                                                 <br><br>
  95.                                                                 RoofersCoffeeShop is not responsible for the content or accuracy of any information posted and shall not be responsible for any decisions made based on such information.
  96.                                                                 <br><br>
  97.                                                                 NOTE:   Only PNG, JPG, GIF, PDF file types are supported.#}
  98.                                                             </div>
  99.                                                         </span>
  100.                                                     {% else %}
  101.                                                         <span>{{field.getTitle()}}:</span>
  102.                                                     {% endif %}
  103.                                                 </label>
  104.                                                 {% if field.getType() == constant("App\\Entity\\FormField::TEXT_FIELD") %}
  105.                                                     <input
  106.                                                         type="text"
  107.                                                         class="form-control"
  108.                                                         {#placeholder="Your First Name"#}
  109.                                                         name="lead_custom[{{field.getTitle()}}]"
  110.                                                         {% if field.getRequired() %} required {% endif %}
  111.                                                     />
  112.                                                 {% elseif field.getType == constant("App\\Entity\\FormField::TEXT_AREA") %}
  113.                                                     <textarea
  114.                                                         class="form-control"
  115.                                                         {#placeholder="Your First Name"#}
  116.                                                         name="lead_custom[{{field.getTitle()}}]"
  117.                                                         {% if field.getRequired() %} required {% endif %}
  118.                                                     ></textarea>
  119.                                                 {% elseif field.getType == constant("App\\Entity\\FormField::DROP_DOWN") %}
  120.                                                     <select class="form-control" name="lead_custom[{{field.getTitle()}}]" {% if field.getRequired() %} required {% endif %}>
  121.                                                         {% for option in field.getFormFieldOptions() %}
  122.                                                             <option value="{{ option.getValue() }}">{{ option.getValue() }}</option>
  123.                                                         {% endfor %}
  124.                                                     </select>
  125.                                                 {% elseif field.getType == constant("App\\Entity\\FormField::RADIO_BUTTONS") %}
  126.                                                     {% for option in field.getFormFieldOptions() %}
  127.                                                         <div class="form-check">
  128.                                                             <label class="form-check-label">
  129.                                                             <input class="form-check-input" type="radio" name="lead_custom[{{ field.getTitle() }}]" value="{{ option.getValue() }}" {% if field.getRequired() %} required {% endif %}>
  130.                                                             {{ option.getValue() }}
  131.                                                           </label>
  132.                                                         </div>
  133.                                                     {% endfor %}
  134.                                                 {% elseif field.getType == constant("App\\Entity\\FormField::CHECK_BOXES") %}
  135.                                                     {% for option in field.getFormFieldOptions() %}
  136.                                                         <div class="form-check">
  137.                                                             <label class="form-check-label">
  138.                                                             <input class="form-check-input" type="checkbox" name="lead_custom[{{ field.getTitle() }}][]" value="{{ option.getValue() }}">
  139.                                                             {{ option.getValue() }}
  140.                                                           </label>
  141.                                                         </div>
  142.                                                     {% endfor %}
  143.                                                 {% elseif field.getType == constant("App\\Entity\\FormField::IMAGE") %}
  144.                                                     <input type="hidden" name="lead_custom_img[{{field.getTitle()|replace({' ': ''})}}]" value="{{field.getTitle()}}" />
  145.                                                     <input
  146.                                                         type="file"
  147.                                                         name="img_{{field.getTitle()|replace({' ': ''})}}"
  148.                                                         class="form-control"
  149.                                                         {% if field.getRequired() %} required {% endif %}
  150.                                                         accept="image/png,image/gif,image/jpeg,image/jpeg,application/pdf"
  151.                                                     />
  152.                                                 {% elseif field.getType == constant("App\\Entity\\FormField::FILE") %}
  153.                                                     <input type="hidden" name="lead_custom_file[{{field.getTitle()|replace({' ': ''})}}]" value="{{field.getTitle()}}" />
  154.                                                     <input
  155.                                                         type="file"
  156.                                                         name="file_{{field.getTitle()|replace({' ': ''})}}"
  157.                                                         class="form-control"
  158.                                                         {% if field.getRequired() %} required {% endif %}
  159.                                                         {#accept="image/png,image/gif,image/jpeg,image/jpeg,application/pdf"#}
  160.                                                     />
  161.                                                 {% endif %}
  162.                                                 
  163.                                             {% endfor %}
  164.                                             
  165.                                             <div class="form-row g-recaptcha" data-sitekey="6LeEIlMUAAAAAGhdmJJLdJHPxaWx2GqBjber5n6B" required></div>
  166.                                             
  167.                                             {% if page.getLPOptIn() %}
  168.                                                 <label class="btn-block pt-4">
  169.                                                     <input
  170.                                                         type="checkbox"
  171.                                                         name="lead[optin]"
  172.                                                         value="yes"
  173.                                                         required
  174.                                                     />
  175.                                                     <span>{{page.getLPOptIn()}}</span>
  176.                                                 </label>
  177.                                             {% endif %}
  178.                                             
  179.                                             <div style="text-align: center;">
  180.                                                 <button 
  181.                                                     class="btn mt-3"
  182.                                                     type="submit"
  183.                                                     style="color: #fff; background: {{buttonColor}};"
  184.                                                 >{{buttonText}}</button>
  185.                                             </div>
  186.                                         </form>
  187.                                     {# Else use a shortcode for the form if one is set #}
  188.                                     {% elseif page.getLPFormCode() %}
  189.                                         {{ page.getLPFormCode() | wordpress | raw }}
  190.                                     {% else %}
  191.                                     {# Otherwise use the selected pre-set fields #}
  192.                                         <form method="post" class="py-4" enctype="multipart/form-data">
  193.                                             
  194.                                             {% if page.getLPFormFirstname() %}
  195.                                                 <label class="btn-block"><span>First Name:</span>
  196.                                                     <input
  197.                                                         type="text"
  198.                                                         class="form-control"
  199.                                                         placeholder="Your First Name"
  200.                                                         name="lead[firstname]"
  201.                                                         required
  202.                                                     />
  203.                                                 </label>
  204.                                             {% endif %}
  205.                                             
  206.                                             {% if page.getLPFormLastname() %}
  207.                                                     <label class="btn-block"><span>Last Name:</span>
  208.                                                         <input
  209.                                                             type="text"
  210.                                                             class="form-control"
  211.                                                             placeholder="Your Last Name"
  212.                                                             name="lead[lastname]"
  213.                                                             required
  214.                                                         />
  215.                                                     </label>
  216.                                             {% endif %}
  217.                                             
  218.                                             {% if page.getLPFormCompany() %}
  219.                                                 <label class="btn-block"><span>Company:</span>
  220.                                                     <input
  221.                                                         type="text"
  222.                                                         class="form-control"
  223.                                                         placeholder="Your Company"
  224.                                                         name="lead[company]"
  225.                                                     />
  226.                                                 </label>
  227.                                             {% endif %}
  228.                                             
  229.                                             {% if page.getLPFormAddress1() %}
  230.                                                 <label class="btn-block"><span>Address Line 1:</span>
  231.                                                     <input
  232.                                                         type="text"
  233.                                                         class="form-control"
  234.                                                         placeholder="Your Address Line 1"
  235.                                                         name="lead[address1]"
  236.                                                     />
  237.                                                 </label>
  238.                                             {% endif %}
  239.                                             
  240.                                             {% if page.getLPFormAddress2() %}
  241.                                                 <label class="btn-block"><span>Address Line 2:</span>
  242.                                                     <input
  243.                                                         type="text"
  244.                                                         class="form-control"
  245.                                                         placeholder="Your Address Line 2"
  246.                                                         name="lead[address2]"
  247.                                                     />
  248.                                                 </label>
  249.                                             {% endif %}
  250.                                             
  251.                                             {% if page.getLPFormCity() %}
  252.                                                 <label class="btn-block"><span>City:</span>
  253.                                                     <input
  254.                                                         type="text"
  255.                                                         class="form-control"
  256.                                                         placeholder="Your City"
  257.                                                         name="lead[city]"
  258.                                                     />
  259.                                                 </label>
  260.                                             {% endif %}
  261.                                                                         
  262.                                             {% if page.getLPFormState() %}
  263.                                                 <label class="btn-block"><span>State / Region:</span>
  264.                                                     <input
  265.                                                         type="text"
  266.                                                         class="form-control"
  267.                                                         placeholder="Your State / Region"
  268.                                                         name="lead[state]"
  269.                                                     />
  270.                                                 </label>
  271.                                             {% endif %}
  272.                                                                         
  273.                                             {% if page.getLPFormZip() %}
  274.                                                 <label class="btn-block"><span>Zip Code:</span>
  275.                                                     <input
  276.                                                         type="text"
  277.                                                         class="form-control"
  278.                                                         placeholder="Your Zip Code"
  279.                                                         name="lead[zip]"
  280.                                                     />
  281.                                                 </label>
  282.                                             {% endif %}
  283.                                             
  284.                                             {% if page.getLPFormPhone() %}
  285.                                                 <label class="btn-block"><span>Phone:</span>
  286.                                                     <input
  287.                                                         type="text"
  288.                                                         class="form-control"
  289.                                                         placeholder="Your Phone"
  290.                                                         name="lead[phone]"
  291.                                                         required
  292.                                                     />
  293.                                                 </label>
  294.                                             {% endif %}
  295.                                             
  296.                                             {% if page.getLPFormEmail() %}
  297.                                                 <label class="btn-block"><span>Email:</span>
  298.                                                     <input
  299.                                                         type="text"
  300.                                                         class="form-control"
  301.                                                         placeholder="Your Email Address"
  302.                                                         name="lead[email]"
  303.                                                         required
  304.                                                     />
  305.                                                 </label>
  306.                                             {% endif %}
  307.                                             
  308.                                             {% if page.getLPFormContractorType() %}
  309.                                                 <label class="btn-block"><span>Type of Contractor:</span></label>
  310.                                                 <label class="btn-block">
  311.                                                     <input
  312.                                                         type="radio"
  313.                                                         name="lead[contractor_type]"
  314.                                                         value="Primarily Residential"
  315.                                                         required
  316.                                                     />
  317.                                                     <span>Primarily Residential</span>
  318.                                                 </label>
  319.                                                 <label class="btn-block">
  320.                                                     <input
  321.                                                         type="radio"
  322.                                                         name="lead[contractor_type]"
  323.                                                         value="Primarily Commercial"
  324.                                                         required
  325.                                                     />
  326.                                                     <span>Primarily Commercial</span>
  327.                                                 </label>
  328.                                                 <label class="btn-block">
  329.                                                     <input
  330.                                                         type="radio"
  331.                                                         name="lead[contractor_type]"
  332.                                                         value="Both"
  333.                                                         required
  334.                                                     />
  335.                                                     <span>Both</span>
  336.                                                 </label>
  337.                                                 <label class="btn-block">
  338.                                                     <input
  339.                                                         type="radio"
  340.                                                         name="lead[contractor_type]"
  341.                                                         value="Not a Contractor"
  342.                                                         required
  343.                                                     />
  344.                                                     <span>Not a Contractor</span>
  345.                                                 </label>
  346.                                             {% endif %}
  347.                                             
  348.                                             {% if page.getLPFormImage() %}
  349.                                                 <label class="btn-block">
  350.                                                 <span class="rtooltip">Attach Image <i class="fa fa-question-circle"></i>:
  351.                                                     <div class="rtooltiptext" style="top: -305px;left:120px;width:350px;">
  352.                                                         RoofersCoffeeShop offers users the ability to post messages, submit information, and upload images to be used on this site.   This information is shared with advertisers and partners associated with RoofersCoffeeShop.  
  353.                                                         <br><br>
  354.                                                         You acknowledge that you have permission related to Content, Information, and Images submitted and that they do not violate any copyright laws or privacy.   
  355.                                                         <br><br>
  356.                                                         RoofersCoffeeShop is not responsible for the content or accuracy of any information posted and shall not be responsible for any decisions made based on such information.
  357.                                                         <br><br>
  358.                                                         NOTE:   Only PNG, JPG, GIF, PDF file types are supported.
  359.                                                     </div>
  360.                                                 </span>
  361.                                                     {#
  362.                                                     <input type="hidden" name="lead_custom_img[{{field.getTitle()|replace({' ': ''})}}]" value="{{field.getTitle()}}" />
  363.                                                     <input
  364.                                                         type="file"
  365.                                                         name="img_{{field.getTitle()|replace({' ': ''})}}"
  366.                                                         class="form-control"
  367.                                                         {% if field.getRequired() %} required {% endif %}
  368.                                                     />
  369.                                                     #}
  370.                                                     
  371.                                                     <input type="hidden" name="lead_custom_img[attachment]" value="attachment" />
  372.                                                     <input
  373.                                                         type="file"
  374.                                                         name="img_attachment"
  375.                                                         class="form-control"
  376.                                                         accept="image/png,image/gif,image/jpeg,image/jpeg,application/pdf"
  377.                                                     />
  378.                                                 </label>
  379.                                             {% endif %}
  380.                                             
  381.                                             <div class="form-row g-recaptcha" data-sitekey="6LeEIlMUAAAAAGhdmJJLdJHPxaWx2GqBjber5n6B"></div>
  382.                                             
  383.                                             {% if page.getLPOptIn() %}
  384.                                                 <label class="btn-block pt-4">
  385.                                                     <input
  386.                                                         type="checkbox"
  387.                                                         name="lead[optin]"
  388.                                                         value="yes"
  389.                                                         required
  390.                                                     />
  391.                                                     <span>{{page.getLPOptIn()}}</span>
  392.                                                 </label>
  393.                                             {% endif %}
  394.                                             
  395.                                             <div style="text-align: center;">
  396.                                                 <button 
  397.                                                     class="btn mt-3"
  398.                                                     type="submit"
  399.                                                     style="color: #fff; background: {{buttonColor}};"
  400.                                                 >{{buttonText}}</button>
  401.                                             </div>
  402.                                         </form>
  403.                                     {% endif %}
  404.                                     
  405.                                 </div>
  406.                                 {# Right Column #}
  407.                                 <div class="col-md-6 p-3" style="background: {{page.getLPRightColor()}};">
  408.                                     {{ page.getLPRight()|raw }}
  409.                                 </div>
  410.                             </div>
  411.                             
  412.                             {# Footer #}
  413.                             <div class="row" style="min-height: 10px;">
  414.                                 <div class="col-md-12 p-3" style="background: {{page.getLPFooterColor()}};">
  415.                                     {{ page.getLPFooter()|raw }}
  416.                                 </div>
  417.                             </div>
  418.                             
  419.                         </div>
  420.                     </div>
  421.                     
  422.                     
  423.                 {% else %}
  424.                     
  425.                     {# looks to be working ... #}                    
  426.                     
  427.                     {% set modules = page.getContentMetaValueByKey("mtm_content_modules") %}
  428.                     {% if modules %}
  429.                         {% set modules = unserialize(modules) %}
  430.                         {% include "content/tmpl/mtm-module-loop.html.twig" %}
  431.                     {% endif %}
  432.                         
  433.                     {#
  434.                     <table class="table">
  435.                     {% for meta in page.getContentMeta() %}
  436.                         <tr>
  437.                             <td>{{ meta.getMetakey() }}:</td>
  438.                             <td>{{ meta.getMetavalue() }}</td>
  439.                         </tr>
  440.                     {% endfor %}
  441.                     </table>
  442.                     #}
  443.                     
  444.                 {% endif %}
  445.                 </div>
  446.             </div>
  447.         </div>
  448.         
  449.         {% if background is not empty %}
  450.             </div>
  451.         {% endif %}
  452.     {% else %}
  453.         <div class="container">
  454.             <div class="row">
  455.                 <div class="col-sm-8">
  456.                     {{ page.content_full | raw }}
  457.                 </div>
  458.                 <div class="col-sm-4">
  459.                     [Sidebar]
  460.                 </div>
  461.             </div>
  462.         </div>
  463.     {% endif %}
  464. {% endblock %}