templates/modules/directory.html.twig line 1

Open in your IDE?
  1. {# directory sidebar module #}
  2. <div class="d-block d-lg-none" style="padding:25px;"><hr></div>
  3. <div class="module" id="connectwithus">
  4.     <div class="module-content" style="overflow-wrap: break-word;">
  5.     
  6.         {% if customer is not empty %}
  7.             {% set media = customer.getMedia() %}
  8.             {% set media2 = customer.getLogo() %}
  9.             {% if media %}
  10.             {{ media.getImageTag("","display: block; margin: 0 auto;")|raw }}
  11.             <br>
  12.             {% elseif media2 %}
  13.                 <img 
  14.                 src="/uploads/content/{{ media2.getName() }}" 
  15.                 style="display: block; margin: 0 auto;" 
  16.                 loading='lazy'
  17.             />
  18.             <br>
  19.             {% endif %}
  20.         {% elseif content and content.getFeaturedImageTag() is not empty %}
  21.             {{ content.getFeaturedImageTag("d-block mx-auto my-auto","")|raw }}
  22.             <br />
  23.         {% endif %}
  24.         {% if customer is not empty %}
  25.         
  26.             {% if customer.email is not empty or customer.youtube3 is not empty %}
  27.                 <a 
  28.                     href="{{customer.youtube3 ? customer.youtube3 : "#" }}" 
  29.                     id="{{customer.youtube3 ? "external-request_info" : "request_info" }}"
  30.                     class="button alt mb-3 no-track" 
  31.                     style="width: 100%; text-align: center; padding: 10px 0px 10px;"
  32.                 >Request More Information</a>
  33.                 <br><br>
  34.             {% endif %}
  35.             
  36.             {% if customer.addresses is not empty %}
  37.                 <div>
  38.                     {% for address in customer.addresses %}
  39.                         <div style="padding-bottom: 10px;">
  40.                             {% if address.title is not empty %}<strong>{{ address.title }}:</strong><br>{% endif %}
  41.                             {% if address.addressline1 is not empty %}{{ address.addressline1 }}<br>{% endif %}
  42.                             {% if address.addressline2 is not empty %}{{ address.addressline2 }}<br>{% endif %}
  43.                             {% if address.city is not empty %}{{ address.city }}, {% endif %}
  44.                             {% if address.stateprovince is not empty %}{{ address.stateprovince }} {% endif %}
  45.                             {% if address.postalcode is not empty %}{{ address.postalcode }} {% endif %}
  46.                             {% if address.city is not empty or address.stateprovince is not empty or address.postalcode is not empty%}<br>{% endif %}
  47.                             {% if address.country is not empty %}{{ address.country }}<br>{% endif %}
  48.                         </div>
  49.                     {% endfor %}
  50.                 </div>
  51.             {% endif %}
  52.         {% elseif content and content.getContentMetaValueByKey('_company_address') is not empty %}
  53.             <div class="mb-3">
  54.                 {{ content.getContentMetaValueByKey('_company_address') }}
  55.             </div>        
  56.         {% endif %}
  57.         
  58.         {% if customer is not empty %}
  59.             {% if customer.phones is not empty %}
  60.                 {% set hasphones = false %}
  61.                 {% for phone in customer.phones %}
  62.                     {% if phone.number is not empty %}
  63.                         {% set hasphones = true %}
  64.                     {% endif %}
  65.                 {% endfor %}
  66.             
  67.                 <div {{ (hasphones) ? "style='padding-bottom: 10px;'": "" }}>
  68.                     {% for phone in customer.phones %}
  69.                         {% if phone.number is not empty %}
  70.                                 <strong>{{ phone.title }}: </strong> <br/> <a href="tel:{{ phone.number }}">{{ phone.number }}</a><br>
  71.                         {% endif %}
  72.                     {% endfor %}
  73.                 </div>
  74.             {% endif %}
  75.         {% elseif content and content.getContentMetaValueByKey('_company_phone') is not empty %}
  76.             <div class="mb-3">
  77.                 <strong>Phone:</strong>
  78.                 <a href="{{ content.getContentMetaValueByKey('_company_phone') }}">
  79.                     {{ content.getContentMetaValueByKey('_company_phone') }}
  80.                 </a>
  81.             </div>
  82.         {% endif %}
  83.         
  84.         
  85.         {% if customer is not empty %}
  86.             {% if customer.email is not empty %}
  87.                 {% if emails_is_valid is not defined %}
  88.                     {% set email_is_valid = false %}
  89.                 {% endif %}
  90.                 <div style="padding-bottom: 10px;">
  91.                     <strong>Contact Us:</strong><br/> <a href="{{ customer.email|external_link }}" target={{ email_is_valid ? "_self" : "_blank" }}>{{ customer.email }}</a><br>
  92.                 </div>
  93.             {% endif %}
  94.         {% elseif content and content.getContentMetaValueByKey('_company_email') is not empty %}
  95.             <div style="padding-bottom: 10px;">
  96.                 <strong>Contact Us:</strong> <a href="mailto:{{ content.getContentMetaValueByKey('_company_email') }}">
  97.                     {{ content.getContentMetaValueByKey('_company_email') }}
  98.                 </a><br>
  99.             </div>
  100.         {% endif %}
  101.         
  102.         
  103.         {% if customer is not empty %}
  104.             {% if customer.websites is not empty %}
  105.                 <strong>Websites:</strong><br>
  106.                 <div style='padding-bottom: 10px;'>
  107.                     <ul style="padding-left: 1em;">
  108.                     {% for website in customer.websites %}
  109.                         <li style="margin: 5px 0;"><a href="{{ website.getSiteUrl()|external_link }}">{{ website.getSiteDisplayText() }}</a></li>
  110.                     {% endfor %}
  111.                     </ul>
  112.                 </div>
  113.             {% endif %}
  114.         {% elseif content and content.getContentMetaValueByKey('_company_phone') is not empty %}
  115.             {# Old way with only one website: #}
  116.             {% if customer is not empty and customer.website is not empty %}
  117.                 <div>
  118.                     <strong>Website:</strong> <a href="{{ customer.website|external_link }}">{{ customer.getWebsiteTitleText() }}</a><br><br>
  119.                 </div>
  120.             {% elseif content and content.getContentMetaValueByKey('_company_website') is not empty %}
  121.                 <div>
  122.                     <strong>Website:</strong> <a href="{{ content.getContentMetaValueByKey('_company_website')|external_link }}">
  123.                         {{ content.getContentMetaValueByKey('_company_website') }}
  124.                     </a><br><br>
  125.                 </div>
  126.             {% endif %}
  127.         {% endif %}
  128.         
  129.         
  130.         
  131.         
  132.         
  133.         
  134.         
  135.         
  136.         {% if customer is not empty %}
  137.             {% if customer.facebook is not empty or customer.twitter is not empty or customer.linkedin is not empty or customer.instagram is not empty or customer.youtube is not empty%}
  138.                 <div class="social">
  139.                     <strong>Social Media:</strong><br>
  140.                     {% if customer.facebook is not empty %}
  141.                         <a href="{{ customer.facebook }}" aria-label="Facebook"><i class="fa fa-facebook"></i></a>
  142.                     {% endif %}
  143.                     {% if customer.twitter is not empty %}
  144.                         <a href="https://twitter.com/{{ customer.twitter }}" aria-label="Twitter"><i class="fa fa-twitter"></i></a>
  145.                     {% endif %}
  146.                     {% if customer.linkedin is not empty %}
  147.                         <a href="{{ customer.linkedin }}" aria-label="LinkedIn"><i class="fa fa-linkedin"></i></a>
  148.                     {% endif %}
  149.                     {% if customer.instagram is not empty %}
  150.                         <a href="{{ customer.instagram }}" aria-label="Instagram"><i class="fa fa-instagram"></i></a>
  151.                     {% endif %}
  152.                      {% if customer.youtube2 is not empty %}
  153.                         <a href="{{ customer.youtube2 }}" aria-label="Tiktok"><i class="fa-brands fa-tiktok"></i></a>
  154.                     {% endif %}
  155.                     {% if customer.youtube is not empty %}
  156.                         <a href="{{ customer.youtube }}" aria-label="YouTube"><i class="fa fa-youtube"></i></a>
  157.                     {% endif %}
  158.                     {% if content is not empty %}
  159.                         <a href="/rss/{{ content.getSlug() }}" aria-label="RSS" target="_blank"><i class="fa fa-rss"></i></a>
  160.                     {% endif %}
  161.                 </div><br>
  162.             {% endif %}
  163.         {% elseif content is not empty %}
  164.             {% set social_out = false %}            
  165.             {% if content.getContentMetaValueByKey('_company_facebook') is not empty %}
  166.                 {% if not social_out %}
  167.                     <div class="social">
  168.                     <strong>Social Media:</strong>
  169.                     {% set social_out = true %}
  170.                 {% endif %}
  171.                 <a href="{{ content.getContentMetaValueByKey('_company_facebook') }}" aria-label="Facebook"><i class="fa fa-facebook"></i></a>
  172.             {% endif %}
  173.             
  174.             {% if content.getContentMetaValueByKey('_company_twitter') is not empty %}
  175.                 {% if not social_out %}
  176.                     <div class="social">
  177.                     <strong>Social Media:</strong>
  178.                     {% set social_out = true %}
  179.                 {% endif %}
  180.                 <a href="{{ content.getContentMetaValueByKey('_company_twitter') }}" aria-label="Twitter"><i class="fa fa-twitter"></i></a>
  181.             {% endif %}
  182.             
  183.             {% if content.getContentMetaValueByKey('_company_linkedin') is not empty %}
  184.                 {% if not social_out %}
  185.                     <div class="social">
  186.                     <strong>Social Media:</strong>
  187.                     {% set social_out = true %}
  188.                 {% endif %}
  189.                 <a href="{{ content.getContentMetaValueByKey('_company_linkedin') }}" aria-label="LinkedIn"><i class="fa fa-linkedin"></i></a>
  190.             {% endif %}
  191.             
  192.             {% if content.getContentMetaValueByKey('_company_instagram') is not empty %}
  193.                 {% if not social_out %}
  194.                     <div class="social">
  195.                     <strong>Social Media:</strong>
  196.                     {% set social_out = true %}
  197.                 {% endif %}
  198.                 <a  href="{{ content.getContentMetaValueByKey('_company_instagram') }}" aria-label="Instagram"><i class="fa fa-instagram"></i></a>
  199.             {% endif %}
  200.             
  201.             {% if content.getContentMetaValueByKey('_company_youtube') is not empty %}
  202.                 {% if not social_out %}
  203.                     <div class="social">
  204.                     <strong>Social Media:</strong>
  205.                     {% set social_out = true %}
  206.                 {% endif %}
  207.                 <a href="{{ content.getContentMetaValueByKey('_company_youtube') }}" aria-label="YouTube"><i class="fa fa-youtube"></i></a>
  208.             {% endif %}
  209.             
  210.             {% if social_out %}
  211.             </div>
  212.             {% endif %}
  213.         
  214.         {% endif %}
  215.         
  216.         {% if show_upcoming is defined and show_upcoming %}
  217.             {% if customer is not empty and customer.externalevents is not null and customer.externalevents.menuitems is not empty %}
  218.                     {% for event in customer.externalevents.menuitems %}
  219.                         {% if event.title is not empty and event.link is not empty and event.link.refexternal is not empty %}
  220.                         <div>
  221.                             <strong>Featured Event:</strong><br>
  222.                                 <ul style="padding-left: 1em;">
  223.                                     <li style="margin: 5px 0;"><a href="{{ event.link.refexternal|external_link }}">{{ event.title }}</a></li>
  224.                                 </ul>
  225.                         </div>
  226.                         {% endif %}
  227.                     {% endfor %}
  228.             {% endif %}
  229.             
  230.             {% if upcoming_events is defined and upcoming_events is not empty %}
  231.                 <div>
  232.                     <strong>Upcoming Events:</strong><br>
  233.                     <ul style="padding-left: 1em;">
  234.                     {% for event in upcoming_events %}
  235.                         <li style="margin: 5px 0;"><a href="/event/{{ event.slug }}">{{ event.title }}</a></li>
  236.                     {% endfor %}
  237.                     </ul>
  238.                 </div>
  239.             {% endif %}
  240.             
  241.         {% endif %}
  242.         
  243.         {% if customer is not empty and show_newsletters is defined and show_newsletters and customer.newsletters is not null and customer.newsletters.menuitems is not empty %}
  244.             <div>
  245.                 <strong>Newsletters:</strong><br>
  246.                 <ul style="padding-left: 1em;">
  247.                 
  248.                 {% for newsletter in customer.newsletters.menuitems %}
  249.                 {% if newsletter.link %}
  250.                     <li style="margin: 5px 0;"><a href="{{ newsletter.link.refexternal|external_link }}">{{ newsletter.title }}</a></li>
  251.                 {% endif %}
  252.                 {% endfor %}
  253.                 
  254.                 </ul>
  255.             </div>
  256.         {% endif %}
  257.         
  258.         {% if show_coffeeblog is defined and show_coffeeblog and latest_news is defined and latest_news is not empty %}
  259.             <div>
  260.                 <strong>Latest Coffee Shop News:</strong><br>
  261.                 <ul style="padding-left: 1em;">
  262.                 {% for post in latest_news %}
  263.                     <li style="margin: 5px 0;"><a href="{{ post.getFullURL() }}">{{ post.title }}</a></li>
  264.                 {% endfor %}
  265.                 <a href="{{ meta.root }}/posts"><i class="fa fa-caret-right"></i><strong> Read More</strong></a>
  266.                 </ul>
  267.             </div>
  268.         {% endif %}
  269.         
  270.         {% if customer is not empty and show_literature is defined and show_literature and customer.literature is not null and customer.literature.mediagroupitems is not empty %}
  271.             <div>
  272.                 <strong>Literature Downloads:</strong><br>
  273.                 <ul style="padding-left: 1em;">
  274.                 {% for literature in customer.literature.mediagroupitems %}
  275.                     <li style="margin: 5px 0;">
  276.                     {% if literature.media is not null %}
  277.                         <a href="{{ literature.media.getURL() }}">
  278.                             {{ literature.title }}
  279.                         </a>
  280.                     {% else %}
  281.                         <a href="{{ literature.externalurl|external_link }}">
  282.                             {{ literature.title }}
  283.                         </a>
  284.                     {% endif %}
  285.                     </li>
  286.                 {% endfor %}
  287.                 </ul>
  288.             </div>
  289.         {% endif %}
  290.         
  291.     </div>
  292. </div>
  293. {% if preview is not defined or not preview %}
  294.     <div id="modal" class="modal show" tabindex="-1" role="dialog">
  295.       <div class="modal-dialog" role="document">
  296.         <div class="modal-content">
  297.           <div class="modal-body">
  298.             <button class="close float-right" type="button"><i class="fa fa-times"></i></button>
  299.             {# include the directory lead form #}
  300.             
  301.             {#
  302.             {% for sidebar in sidebars %}
  303.                     
  304.                 {% if sidebar.id is defined and sidebar.id == 'directory_lead' %}
  305.                     {{ show_module(sidebar) }}
  306.                 {% endif %}
  307.             {% endfor %}
  308.             #}
  309.             {% include "forms/directory-lead.html.twig" %}
  310.           </div>
  311.         </div>
  312.       </div>
  313.     </div>
  314. {% endif %}