templates/modules/default-loop.html.twig line 1

Open in your IDE?
  1. {% extends "modules/tmpl/default.html.twig" %}
  2. {% block module_content %}
  3.     {% set custom_html = '' %}
  4.     {% set count = 0 %}
  5.     {% if module.data is empty and module.no_content_message is defined and module.no_content_message %}
  6.         <div
  7.             style="text-align:center;">
  8.             {#No content found.#}
  9.             {{ module.no_content_message }}
  10.         </div>
  11.     {% endif %}
  12.     {% for c in module.data %}
  13.         <div class="row mb-3">
  14.             {% if c.getType == constant("App\\Entity\\Content::CLASSIFIED") %}
  15.                 {% if custom_html == '' %}
  16.                     {% set custom_html = '<hr /><a href="/our-listings">View All Listings</a>' %}
  17.                 {% endif %}
  18.                 <div class="col-md-12 mb-2">
  19.                     <a href="{{ c.getURL() }}">
  20.                         <div>
  21.                             <div class="m-0 module-subtitle">{{ c.getTitle()|raw }}</div>
  22.                             <span style="color: #696969;">{{ c.getContentMetaValueByKey("_job_location") }}</span>
  23.                             <i class="fa fa-caret-right"></i>
  24.                             <span style="color: #696969;">{{ c.getContentMetaValueByKey("_company_name") }}</span>
  25.                             <i class="fa fa-caret-right"></i>
  26.                             {% set type = c.getSecondaryCategoriesByTaxonomy("job_listing_type") %}
  27.                             {% if type is not empty %}
  28.                                 {% if 1 < type | length %}
  29.                                     <span style="color: #696969;">Multiple</span>
  30.                                 {% else %}
  31.                                     <span style="color: #696969;">{{ type[0].getTitle()|raw }}</span>
  32.                                 {% endif %}
  33.                             {% endif %}
  34.                         </div>
  35.                     </a>
  36.                 </div>
  37.             {% else %}
  38.                 {% if (c.getFeaturedImageTag() and (module.show_images is not defined or (module.show_images is defined and module.show_images == "yes"))) %}
  39.                     {# or (c.type == 15 and (module.show_hub_categories is not defined or (module.show_images is defined and module.show_hub_categories == "yes"))) #}
  40.                     {% if module.class is defined and 'full-image' in module.class %}
  41.                         <div class="col-md-{{ module.col_image is defined ? module.col_image : '12' }} col-image">
  42.                         {% else %}
  43.                             <div class="col-md-{{ module.col_image is defined ? module.col_image : '3' }} col-image">
  44.                             {% endif %}
  45.                             <a href="{{ c.getURL() }}">
  46.                                 {{ c.getFeaturedImageTag()|raw }}
  47.                             </a>
  48.                             {% if c.type == 15 and module.show_hub_categories is not defined or (module.show_images is defined and module.show_hub_categories == "yes") %}
  49.                                 {% set resourceTypes = c.getSecondaryCategoriesByTaxonomy("resource-type") %}
  50.                                 {% set industryType = c.getSecondaryCategoriesByTaxonomy("industry") | first %}
  51.                                 {#{% set presentedBys = c.getSecondaryCategoriesByTaxonomy("rcs-content-provider") %}#}
  52.                                 {% set presentedBys = c.getCustomers() %}
  53.                                 {% set accessLevel = c.getSecondaryCategoriesByTaxonomy("access-level") | first %}
  54.                                 <ul class="hubitems" style="padding-left: 15px; font-size: .9em;">
  55.                                     {% if resourceTypes is not empty %}
  56.                                         <li>
  57.                                             <strong>
  58.                                                 <em>Resource Type:</em>
  59.                                             </strong>
  60.                                             {% for resourceType in resourceTypes %}
  61.                                                 <br/><a href="{{ resourceType.getURL() }}">{{ resourceType.getTitle()|raw }}</a>
  62.                                             {% endfor %}
  63.                                         </li>
  64.                                     {% endif %}
  65.                                     {% if industryType is not empty %}
  66.                                         <li>
  67.                                             <strong>
  68.                                                 <em>Industry:</em>
  69.                                             </strong>
  70.                                             <br/><a href="{{ industryType.getURL() }}">{{ industryType.getTitle()|raw }}</a>
  71.                                         </li>
  72.                                     {% endif %}
  73.                                     {% if presentedBys is not empty %}
  74.                                         <li>
  75.                                             <strong>
  76.                                                 <em>Presented By:</em>
  77.                                             </strong>
  78.                                             {% for customer in presentedBys %}
  79.                                                 {% if customer.getDirectoryContent() %}
  80.                                                     <br/><a href="/directory/{{ customer.getDirectoryContent().getSlug() }}/content/15" title="{{ customer.getTitle() }}">{{ customer.getTitle() }}</a>
  81.                                                 {% endif %}
  82.                                             {% endfor %}
  83.                                         </li>
  84.                                     {% endif %}
  85.                                     {% if accessLevel is not empty %}
  86.                                         <li>
  87.                                             <strong>
  88.                                                 <em>Access Level:</em>
  89.                                             </strong>
  90.                                             <br/><a href="{{ accessLevel.getURL() }}">{{ accessLevel.getTitle()|raw }}</a>
  91.                                         </li>
  92.                                     {% endif %}
  93.                                 </ul>
  94.                             {% endif %}
  95.                         </div>
  96.                         {% if module.class is defined and 'first-image' in module.class %}
  97.                             <div class="col-md-12 col-text">
  98.                             {% elseif module.class is defined and 'full-image' in module.class %}
  99.                                 <div class="col-md-12 col-text">
  100.                                 {% else %}
  101.                                     <div class="col-md-{{ module.col_text is defined ? module.col_text : '9' }} col-text">
  102.                                     {% endif %}
  103.                                     {#
  104.                                                                                                 {% elseif c.getType == constant("App\\Entity\\Content::WEBINAR") and (module.show_images is not defined or (module.show_images is defined and module.show_images == "yes")) %}
  105.                                                                                                     
  106.                                                                                                     {% set m = module.media[count] %}
  107.                                                                                                     <div class="col-md-{{ module.col_image is defined ? module.col_image : '3' }} col-image">
  108.                                                                                                         <a href="{{ c.getURL() }}">
  109.                                                                                                         {{ m.getImageTag()|raw }}
  110.                                                                                                         </a>
  111.                                                                                                     </div>
  112.                                                                                                     <div class="col-md-{{ module.col_text is defined ? module.col_text : '9' }} col-text">
  113.                                                                                                 #}
  114.                                 {% else %}
  115.                                     <div class="col-md-{{ module.col_text is defined ? module.col_text : '12' }} col-text">
  116.                                     {% endif %}
  117.                                     {% if module.show_titles is not defined or (module.show_titles is defined and module.show_titles == "yes") %}
  118.                                         <div class="module-subtitle m-0">
  119.                                             {% if module.link_titles is not defined or (module.link_titles is defined and module.link_titles == "yes") %}
  120.                                                 {% if module.type == 7 %}
  121.                                                     <a href="/event/{{c.getSlug()}}">
  122.                                                     {% else %}
  123.                                                         <a href="{{ c.getURL() }}">
  124.                                                         {% endif %}
  125.                                                     {% endif %}
  126.                                                     {{ c.getTitle()|raw }}
  127.                                                     {% if module.link_titles is not defined or (module.link_titles is defined and module.link_titles == "yes") %}
  128.                                                     </a>
  129.                                                 {% endif %}
  130.                                             </div>
  131.                                         {% endif %}
  132.                                         {% if c.getType() == 10 %}
  133.                                             <i>{{ c.getAuthor() }}</i>
  134.                                         {% endif %}
  135.                                         {% if module.show_dates is not defined or (module.show_dates is defined and module.show_dates == "yes") %}
  136.                                             {% if (c.getType() == 7 or c.getIsEvent()) and (module.event_show_only_start_date is not defined or (module.event_show_only_start_date is defined and module.event_show_only_start_date == "no")) %}
  137.                                                 {# Events, get date range #}
  138.                                                 <i>{{ c.getEventStartDate() | date | rcsDateFormat }}
  139.                                                     {% if c.getEventEndDate() > c.getEventStartDate() %}
  140.                                                         -
  141.                                                         {{ c.getEventEndDate()| date | rcsDateFormat }}
  142.                                                     {% endif %}
  143.                                                 </i>
  144.                                             {% else %}
  145.                                                 {#<i>{{ c.getPublishedAt() | date("F jS \\a\\t g:ia") }}</i>#}
  146.                                                 {#<i>{{ c.getPublishedAt() | date("F j, Y \\a\\t g:i A") |replace({"AM": "A.M.", "PM": "P.M."}) }}</i>#}
  147.                                                     <i>
  148.                                                 {{ c.getPublishedAt() | date | rcsDateFormat }}
  149.                                             </i>
  150.                                         {% endif %}
  151.                                         {% endif %}
  152.                                             {% if module.show_dates is defined and module.show_dates == "expires" %}
  153.                                             {#<i>{{ c.getExpiresAt() | date("F jS \\a\\t g:ia") }}</i>#}
  154.                                                 <i>
  155.                                             {{ c.getExpiresAt() | date | rcsDateFormat }}
  156.                                         </i>
  157.                                         {% endif %}
  158.                                             {% if c.getType() == 3 %}
  159.                                             {# Classifieds #}
  160.                                             {% set location = c.getContentMetaByKey("_job_location") %}
  161.                                             {% set company = c.getContentMetaByKey("_company_name") %}
  162.                                                 {% if location is not empty %}
  163.                                                     <i>
  164.                                                         <a href="{{ c.getURL() }}"> {{ location.getMetavalue() }}</a>
  165.                                                 </i>
  166.                                             {% endif %}
  167.                                             {% if location is not empty and company is not empty%}
  168.                                                 •
  169.                                             {% endif %}
  170.                                             {% if company is not empty %}
  171.                                                 <i>
  172.                                                     <a href="{{ c.getURL() }}">{{ company.getMetavalue() }}</a>
  173.                                                 </i>
  174.                                             {% endif %}
  175.                                         {% endif %}
  176.                                         {% if module.show_full is defined and module.show_full == "yes" %}
  177.                                             <div class="my-3">{{ c.getContentFull()|wordpress|raw }}</div>
  178.                                             {# the hub link types - TODO - find better place for these exceptions #}
  179.                                             {% if c.getType() == constant("App\\Entity\\Content::THE_HUB") %}
  180.                                                 {% set videoLink = c.getContentMetaValueByKey("rcs_learning_center_video") %}
  181.                                                 {% if videoLink is not empty %}
  182.                                                     <p>
  183.                                                         <a href="{{ videoLink }}">
  184.                                                             <i class="fa fa-play-circle"></i>
  185.                                                             Click here to view the video.</a>
  186.                                                     </p>
  187.                                                 {% endif %}
  188.                                             {% endif %}
  189.                                         {% else %}
  190.                                             {% if module.show_intros is not defined or (module.show_intros is defined and module.show_intros == "yes") %}
  191.                                                 {% set intro_length = module.intro_length is defined ? module.intro_length : 50 %}
  192.                                                 <div class="my-3">
  193.                                                     <span class="sideintrocontent">{{ c.getIntroText(intro_length)|raw }}</span>
  194.                                                 {% endif %}
  195.                                                 {% if module.show_readmores is not defined or (module.show_readmores is defined and module.show_readmores == "yes") %}
  196.                                                     <a href="{{ c.getURL() }}" aria-label="{{ c.getTitle() }}">
  197.                                                         {% if module.readmore_text is defined %}
  198.                                                             {{ module.readmore_text }}
  199.                                                         {% else %}
  200.                                                             Re<i></i>ad Mo<i></i>re
  201.                                                         {% endif %}
  202.                                                     </a>
  203.                                                 {% endif %}
  204.                                                 {% if module.show_intros is not defined or (module.show_intros is defined and module.show_intros == "yes") %}
  205.                                                 </div>
  206.                                             {% endif %}
  207.                                         {% endif %}
  208.                                         {% if (module.show_social is defined and module.show_social == "yes") or (module.class is defined and ("featured-single" in module.class or "featured-single-full" in module.class)) %}
  209.                                             <hr style="margin: 1.5rem 0 .5rem; width: 25%;">
  210.                                             <p class="share-this">Share this:</p>
  211.                                             <a class="social-share-facebook no-track" href="https://www.facebook.com/sharer.php?u={{ app.request.getSchemeAndHttpHost() ~ c.getURL() }}" aria-label="Share on Facebook">
  212.                                                 <i class="fa fa-facebook"></i>
  213.                                             </a>
  214.                                             <a class="social-share-twitter no-track" href="https://twitter.com/intent/tweet?via=roofcoffeeshop&url={{ app.request.getSchemeAndHttpHost() ~ c.getURL() }}" aria-label="Share on Twitter">
  215.                                                 <i class="fa fa-twitter"></i>
  216.                                             </a>
  217.                                             <a class="social-share-linkedin no-track" href="https://www.linkedin.com/shareArticle?mini=true&url={{ app.request.getSchemeAndHttpHost() ~ c.getURL() }}" aria-label="Share on LinkedIn">
  218.                                                 <i class="fa fa-linkedin"></i>
  219.                                             </a>
  220.                                             <a class="social-share-pinterest no-track" href="https://www.pinterest.com/pin/create/button/?url={{ app.request.getSchemeAndHttpHost() ~ c.getURL() }}" aria-label="Share on Pinterest">
  221.                                                 <i class="fa fa-pinterest-p"></i>
  222.                                             </a>
  223.                                         {% endif %}
  224.                                     </div>
  225.                                 {% endif %}
  226.                                 {% set count = count + 1 %}
  227.                             </div>
  228.                         {% endfor %}
  229.                         {% if module.visit_link is defined and module.total > 0 %}
  230.                             <hr/>
  231.                             <a href="{{ module.visit_link }}" class="module-visit-link">
  232.                                 {% if module.visit_text is defined %}
  233.                                     {{ module.visit_text }}
  234.                                 {% else %}
  235.                                     View All
  236.                                 {% endif %}
  237.                                 &raquo;
  238.                             </a>
  239.                         {% endif %}
  240.                         {% if custom_html %}
  241.                             {{ custom_html | raw }}
  242.                             {% set custom_html = '' %}
  243.                         {% endif %}
  244.                         {% if module.pagination is defined %}
  245.                             <hr/>
  246.                             <div class="paginate">
  247.                                 {% if 1 < module.page %}
  248.                                     <a class="float-right" href="{{ meta.root }}?p={{ module.page - 1 }}">Newer Posts &raquo;</a>
  249.                                 {% endif %}
  250.                                 {% if module.limit is defined and module.limit < module.total %}
  251.                                     <a href="{{ meta.root }}?p={{ module.page + 1 }}">&laquo; Older Posts</a>
  252.                                 {% endif %}
  253.                             </div>
  254.                         {% endif %}
  255.                     {% endblock %}