templates/content/tmpl/directory-listing.html.twig line 1

Open in your IDE?
  1. {% extends "1-col-sidebar.html.twig" %}
  2. {# directory listing #}
  3. {% set customer = content.getDirectory() %}
  4. {% block column %}
  5.     {% if site_code is not defined %}
  6.         {% set site_code = '' %}
  7.     {% endif %}
  8.     
  9.     <script src="{{ asset("assets/js/directory-listing.min.js?v=3") }}"></script>
  10.     <div class="directory-listing">
  11.         <a href="/our-directory" class="button alt" style="float: right;">Back to Directory</a><br><br>
  12.         {% if content.getShowTitle() %}
  13.             <h1 class="post-title notranslate directory-title">{{ content.getTitle() }}</h1>
  14.         {% endif %}
  15.         <div>
  16.             {{ content.getContentFull()|wordpress|raw }}
  17.         </div>
  18.         {% if customer is not empty %}
  19.             {# Promos and Rebates #}
  20.             {% if show_promotions and customer.getPromosRebates() is not empty %}
  21.                 <hr>
  22.                 <div>
  23.                     <h2>
  24.                         <strong>Latest Promotions and Rebates</strong>
  25.                     </h2>
  26.                     {% for post in customer.getPromosRebates()|slice(0, 3) %}
  27.                         <div class="row list-row">
  28.                             {% if post.getFeaturedImageTag() is not empty %}
  29.                                 <div class="col-3 post-thumbnail directoryitem">
  30.                                     {{ post.getFeaturedImageTag()|raw }}
  31.                                 </div>
  32.                             {% endif %}
  33.                             <div class={{ (post.getFeaturedImageTag() is empty) ? "col-12" : "col-9" }}>
  34.                                 <h3 class="list-post-title">{{ post.title }}</h3>
  35.                                 <p>{{ post.getIntroText() }}<br>
  36.                                     <a class="readmore" href="{{ post.getFullURL(site_code) }}">View Promotion</a>
  37.                                 </p>
  38.                             </div>
  39.                         </div>
  40.                     {% endfor %}
  41.                     {% if customer.getPromosRebates()|length > 3 %}
  42.                         <div class="row">
  43.                             <div class="col-3"></div>
  44.                             <div class="col-9">
  45.                                 <a class="readmore" href="{{ meta.root }}/content/{{ constant("App\\Entity\\Content::PROMOS_REBATES") }}">
  46.                                     <strong>
  47.                                         See More</strong>
  48.                                 </a>
  49.                             </div>
  50.                         </div>
  51.                     {% endif %}
  52.                 </div>
  53.             {% endif %}
  54.             {% set ebooks = customer.getEbooks(200) %}
  55.             {# Ebooks #}
  56.             {% if show_ebooks and ebooks is not empty %}
  57.                 <hr>
  58.                 <div>
  59.                     <h2>
  60.                         <strong>eBooks</strong>
  61.                     </h2>
  62.                     {% set reBooks = ebooks|shuffle %}
  63.                     {% for post in reBooks|slice(0, 3) %}
  64.                         <div class="row list-row">
  65.                             {% if post.getFeaturedImageTag() is not empty %}
  66.                                 <div class="col-3 post-thumbnail directoryitem">
  67.                                     {{ post.getFeaturedImageTag()|raw }}
  68.                                 </div>
  69.                             {% endif %}
  70.                             <div class={{ (post.getFeaturedImageTag() is empty) ? "col-12" : "col-9" }}>
  71.                                 <h3 class="list-post-title">{{ post.title }}</h3>
  72.                                 <p>{{ post.getIntroText() }}<br>
  73.                                     <a class="readmore" href="{{ post.getFullURL(site_code) }}">View eBook</a>
  74.                                 </p>
  75.                             </div>
  76.                         </div>
  77.                     {% endfor %}
  78.                     {% if ebooks|length > 3 %}
  79.                         <div class="row">
  80.                             <div class="col-3"></div>
  81.                             <div class="col-9">
  82.                                 <a class="readmore" href="{{ meta.root }}/content/{{ constant("App\\Entity\\Content::EBOOK") }}">
  83.                                     <strong>
  84.                                         See More</strong>
  85.                                 </a>
  86.                             </div>
  87.                         </div>
  88.                     {% endif %}
  89.                 </div>
  90.             {% endif %}
  91.             {# Contests and Games #}
  92.             {% if show_contestgames and customer.getContestsGames() is not empty %}
  93.                 <hr>
  94.                 <div>
  95.                     <h2>
  96.                         <strong>Latest Contests and Games</strong>
  97.                     </h2>
  98.                     {% for post in customer.getContestsGames()|slice(0, 3) %}
  99.                         <div class="row list-row">
  100.                             {% if post.getFeaturedImageTag() is not empty %}
  101.                                 <div class="col-3 post-thumbnail directoryitem">
  102.                                     {{ post.getFeaturedImageTag()|raw }}
  103.                                 </div>
  104.                             {% endif %}
  105.                             <div class={{ (post.getFeaturedImageTag() is empty) ? "col-12" : "col-9" }}>
  106.                                 <h3 class="list-post-title">{{ post.title }}</h3>
  107.                                 <p>{{ post.getIntroText() }}<br>
  108.                                     <a class="readmore" href="{{ post.getFullURL(site_code) }}">View Contest or Game</a>
  109.                                 </p>
  110.                             </div>
  111.                         </div>
  112.                     {% endfor %}
  113.                     {% if customer.getContestsGames()|length > 3 %}
  114.                         <div class="row">
  115.                             <div class="col-3"></div>
  116.                             <div class="col-9">
  117.                                 <a class="readmore" href="{{ meta.root }}/content/{{ constant("App\\Entity\\Content::CONTEST_GAMES") }}">
  118.                                     <strong>
  119.                                         See More</strong>
  120.                                 </a>
  121.                             </div>
  122.                         </div>
  123.                     {% endif %}
  124.                 </div>
  125.             {% endif %}
  126.             {# Awards #}
  127.             {% if show_awards and customer.getAwards() is not empty %}
  128.                 <hr>
  129.                 <div>
  130.                     <h2>
  131.                         <strong>Latest Awards</strong>
  132.                     </h2>
  133.                     {% for post in customer.getAwards()|slice(0, 3) %}
  134.                         <div class="row list-row">
  135.                             {% if post.getFeaturedImageTag() is not empty %}
  136.                                 <div class="col-3 post-thumbnail directoryitem">
  137.                                     {{ post.getFeaturedImageTag()|raw }}
  138.                                 </div>
  139.                             {% endif %}
  140.                             <div class={{ (post.getFeaturedImageTag() is empty) ? "col-12" : "col-9" }}>
  141.                                 <h3 class="list-post-title">{{ post.title }}</h3>
  142.                                 <p>{{ post.getIntroText() }}<br>
  143.                                     <a class="readmore" href="{{ post.getFullURL(site_code) }}">View Award</a>
  144.                                 </p>
  145.                             </div>
  146.                         </div>
  147.                     {% endfor %}
  148.                     {% if customer.getAwards()|length > 3 %}
  149.                         <div class="row">
  150.                             <div class="col-3"></div>
  151.                             <div class="col-9">
  152.                                 <a class="readmore" href="{{ meta.root }}/content/{{ constant("App\\Entity\\Content::AWARD") }}">
  153.                                     <strong>
  154.                                         See More</strong>
  155.                                 </a>
  156.                             </div>
  157.                         </div>
  158.                     {% endif %}
  159.                 </div>
  160.             {% endif %}
  161.             {# Scholarships #}
  162.             {% if show_scholarships and customer.getScholarships() is not empty %}
  163.                 <hr>
  164.                 <div>
  165.                     <h2>
  166.                         <strong>Latest Scholarships</strong>
  167.                     </h2>
  168.                     {% for post in customer.getScholarships()|slice(0, 3) %}
  169.                         <div class="row list-row">
  170.                             {% if post.getFeaturedImageTag() is not empty %}
  171.                                 <div class="col-3 post-thumbnail directoryitem">
  172.                                     {{ post.getFeaturedImageTag()|raw }}
  173.                                 </div>
  174.                             {% endif %}
  175.                             <div class={{ (post.getFeaturedImageTag() is empty) ? "col-12" : "col-9" }}>
  176.                                 <h3 class="list-post-title">{{ post.title }}</h3>
  177.                                 <p>{{ post.getIntroText() }}<br>
  178.                                     <a class="readmore" href="{{ post.getFullURL(site_code) }}">View Scholarship</a>
  179.                                 </p>
  180.                             </div>
  181.                         </div>
  182.                     {% endfor %}
  183.                     {% if customer.getScholarships()|length > 3 %}
  184.                         <div class="row">
  185.                             <div class="col-3"></div>
  186.                             <div class="col-9">
  187.                                 <a class="readmore" href="{{ meta.root }}/content/{{ constant("App\\Entity\\Content::SCHOLARSHIP") }}">
  188.                                     <strong>
  189.                                         See More</strong>
  190.                                 </a>
  191.                             </div>
  192.                         </div>
  193.                     {% endif %}
  194.                 </div>
  195.             {% endif %}
  196.             {# Spanish Content #}
  197.             {% if spanish_content is not empty %}
  198.                 <hr>
  199.                 <div>
  200.                     <h2>
  201.                         <strong>Latest Spanish Content</strong>
  202.                     </h2>
  203.                     {% for post in spanish_content|slice(0, 3) %}
  204.                         <div class="row list-row">
  205.                             {% if post.getFeaturedImageTag() is not empty %}
  206.                                 <div class="col-3 post-thumbnail directoryitem">
  207.                                     {{ post.getFeaturedImageTag()|raw }}
  208.                                 </div>
  209.                             {% endif %}
  210.                             <div class={{ (post.getFeaturedImageTag() is empty) ? "col-12" : "col-8" }}>
  211.                                 <h3 class="list-post-title">{{ post.title }}</h3>
  212.                                 <p>{{ post.getIntroText() }}<br>
  213.                                     <a class="readmore" href="{{ post.getFullURL(site_code) }}">View Content</a>
  214.                                 </p>
  215.                             </div>
  216.                         </div>
  217.                     {% endfor %}
  218.                     {% if spanish_content|length > 3 %}
  219.                         <div class="row">
  220.                             <div class="col-3"></div>
  221.                             <div class="col-9">
  222.                                 <a class="readmore" href="{{ meta.root }}/content/spanish">
  223.                                     <strong>
  224.                                         See More</strong>
  225.                                 </a>
  226.                             </div>
  227.                         </div>
  228.                     {% endif %}
  229.                 </div>
  230.             {% endif %}
  231.             {# International Content #}
  232.             {% if int_content is not empty %}
  233.                 <hr>
  234.                 <div>
  235.                     <h2>
  236.                         <strong>Latest International Content</strong>
  237.                     </h2>
  238.                     {% for post in int_content|slice(0, 3) %}
  239.                         <div class="row list-row">
  240.                             {% if post.getFeaturedImageTag() is not empty %}
  241.                                 <div class="col-3 post-thumbnail directoryitem">
  242.                                     {{ post.getFeaturedImageTag()|raw }}
  243.                                 </div>
  244.                             {% endif %}
  245.                             <div class={{ (post.getFeaturedImageTag() is empty) ? "col-12" : "col-8" }}>
  246.                                 <h3 class="list-post-title">{{ post.title }}</h3>
  247.                                 <p>{{ post.getIntroText() }}<br>
  248.                                     <a class="readmore" href="{{ post.getFullURL(site_code) }}">View Content</a>
  249.                                 </p>
  250.                             </div>
  251.                         </div>
  252.                     {% endfor %}
  253.                     {% if int_content|length > 3 %}
  254.                         <div class="row">
  255.                             <div class="col-3"></div>
  256.                             <div class="col-9">
  257.                                 <a class="readmore" href="{{ meta.root }}/content/international">
  258.                                     <strong>
  259.                                         See More</strong>
  260.                                 </a>
  261.                             </div>
  262.                         </div>
  263.                     {% endif %}
  264.                 </div>
  265.             {% endif %}
  266.             {# Canada Content #}
  267.             {% if canada_content is not empty %}
  268.                 <hr>
  269.                 <div>
  270.                     <h2>
  271.                         <strong>Latest Canada Content</strong>
  272.                     </h2>
  273.                     {% for post in canada_content|slice(0, 3) %}
  274.                         <div class="row list-row">
  275.                             {% if post.getFeaturedImageTag() is not empty %}
  276.                                 <div class="col-3 post-thumbnail directoryitem">
  277.                                     {{ post.getFeaturedImageTag()|raw }}
  278.                                 </div>
  279.                             {% endif %}
  280.                             <div class={{ (post.getFeaturedImageTag() is empty) ? "col-12" : "col-8" }}>
  281.                                 <h3 class="list-post-title">{{ post.title }}</h3>
  282.                                 <p>{{ post.getIntroText() }}<br>
  283.                                     <a class="readmore" href="{{ post.getFullURL(site_code) }}">View Content</a>
  284.                                 </p>
  285.                             </div>
  286.                         </div>
  287.                     {% endfor %}
  288.                     {% if canada_content|length > 3 %}
  289.                         <div class="row">
  290.                             <div class="col-3"></div>
  291.                             <div class="col-9">
  292.                                 <a class="readmore" href="{{ meta.root }}/content/canada">
  293.                                     <strong>
  294.                                         See More</strong>
  295.                                 </a>
  296.                             </div>
  297.                         </div>
  298.                     {% endif %}
  299.                 </div>
  300.             {% endif %}
  301.             {# Podcasts #}
  302.             {% if show_podcasts and customer.getPodcasts() is not empty %}
  303.                 <hr>
  304.                 <div>
  305.                     <h2>
  306.                         <strong>Latest Podcasts</strong>
  307.                     </h2>
  308.                     {% for post in customer.getPodcasts()|slice(0, 3) %}
  309.                         <div class="row list-row">
  310.                             {% if post.getFeaturedImageTag() is not empty %}
  311.                                 <div class="col-3 post-thumbnail directoryitem">
  312.                                     {{ post.getFeaturedImageTag()|raw }}
  313.                                 </div>
  314.                             {% endif %}
  315.                             <div class={{ (post.getFeaturedImageTag() is empty) ? "col-12" : "col-8" }}>
  316.                                 <h3 class="list-post-title">{{ post.title }}</h3>
  317.                                 <p>{{ post.getIntroText() }}<br>
  318.                                     <a class="readmore" href="{{ post.getFullURL(site_code) }}">Listen to the Podcast</a>
  319.                                 </p>
  320.                             </div>
  321.                         </div>
  322.                     {% endfor %}
  323.                     {% if customer.getPodcasts()|length > 3 %}
  324.                         <div class="row">
  325.                             <div class="col-3"></div>
  326.                             <div class="col-9">
  327.                                 <a class="readmore" href="{{ meta.root }}/content/{{ constant("App\\Entity\\Content::PODCAST") }}">
  328.                                     <strong>
  329.                                         Listen More</strong>
  330.                                 </a>
  331.                             </div>
  332.                         </div>
  333.                     {% endif %}
  334.                 </div>
  335.             {% endif %}
  336.             {# Webinars #}
  337.             {% if show_webinars and customer.getWebinars() is not empty %}
  338.                 <hr>
  339.                 <div>
  340.                     <h2>
  341.                         <strong>Latest Webinars</strong>
  342.                     </h2>
  343.                     {% for post in customer.getWebinars()|slice(0, 3) %}
  344.                         <div class="row list-row">
  345.                             {% if post.getFeaturedImageTag() is not empty %}
  346.                                 <div class="col-3 post-thumbnail directoryitem">
  347.                                     {{ post.getFeaturedImageTag()|raw }}
  348.                                 </div>
  349.                             {% endif %}
  350.                             <div class={{ (post.getFeaturedImageTag() is empty) ? "col-12" : "col-9" }}>
  351.                                 <h3 class="list-post-title">{{ post.title }}</h3>
  352.                                 <p>{{ post.getIntroText() }}<br>
  353.                                     <a class="readmore" href="{{ post.getFullURL(site_code) }}">Watch the Webinar</a>
  354.                                 </p>
  355.                             </div>
  356.                         </div>
  357.                     {% endfor %}
  358.                     {% if customer.getWebinars()|length > 3 %}
  359.                         <div class="row">
  360.                             <div class="col-3"></div>
  361.                             <div class="col-9">
  362.                                 <a class="readmore" href="{{ meta.root }}/content/{{ constant("App\\Entity\\Content::WEBINAR") }}">
  363.                                     <strong>
  364.                                         See More</strong>
  365.                                 </a>
  366.                             </div>
  367.                         </div>
  368.                     {% endif %}
  369.                 </div>
  370.             {% endif %}
  371.             {# Educational Content (TheHUB) #}
  372.             {% if show_education and customer.getHUBContent() is not empty %}
  373.                 <hr>
  374.                 <div>
  375.                     <h2>
  376.                         <strong>Read Listen Watch - Educational Content</strong>
  377.                     </h2>
  378.                     {% for post in customer.getHUBContent()|slice(0, 3) %}
  379.                         <div class="row list-row">
  380.                             {% if post.getFeaturedImageTag() is not empty %}
  381.                                 <div class="col-3 post-thumbnail directoryitem">
  382.                                     {{ post.getFeaturedImageTag()|raw }}
  383.                                 </div>
  384.                             {% endif %}
  385.                             <div class={{ (post.getFeaturedImageTag() is empty) ? "col-12" : "col-9" }}>
  386.                                 <h3 class="list-post-title">{{ post.title }}</h3>
  387.                                 {# <p>{{ post.contentfull|snippet(320) }}<br> #}
  388.                                 <p>{{ post.getIntroText() }}<br>
  389.                                     <a class="readmore" href="{{ post.getFullURL(site_code) }}">View Content</a>
  390.                                 </p>
  391.                             </div>
  392.                         </div>
  393.                     {% endfor %}
  394.                     {% if customer.getHUBContent()|length > 3 %}
  395.                         <div class="row">
  396.                             <div class="col-3"></div>
  397.                             <div class="col-9">
  398.                                 <a class="readmore" href="{{ meta.root }}/content/{{ constant("App\\Entity\\Content::THE_HUB") }}">
  399.                                     <strong>
  400.                                         See More</strong>
  401.                                 </a>
  402.                             </div>
  403.                         </div>
  404.                     {% endif %}
  405.                 </div>
  406.             {% endif %}
  407.             {# Classifieds #}
  408.             {% if show_classifieds and customer.getClassifieds() is not empty %}
  409.                 <hr>
  410.                 <div>
  411.                     <h2>
  412.                         <strong>Latest Classifieds</strong>
  413.                     </h2>
  414.                     {% for post in customer.getClassifieds()|slice(0, 3) %}
  415.                         <div
  416.                             style="height: 200px;" class="row list-row" {% if post.getVideoMedia() %} data-video-row="{{post.getVideoMedia().getId()}}" {% endif %}>
  417.                             {# {% if post.getFeaturedImageTag() is not empty %}
  418.                                                                                         <div class="col-3 post-thumbnail directoryitem">
  419.                                                                                             {% if post.hasVideoMedia() %}
  420.                                                                                                 {{ post.getVideoMediaTag("","", false)|raw }}
  421.                                                                                             {% elseif post.getFeaturedImageTag() is not empty %}
  422.                                                                                                 {{ post.getFeaturedImageTag("","")|raw }}
  423.                                                                                             {% endif %}
  424.                                                                                         </div>
  425.                                                                                     {% endif %} #}
  426.                             <div class="col-sm-2 post-thumbnail directoryitem">
  427.                                 {% if post.hasVideoMedia() %}
  428.                                     <a href="{{ post.getURL() }}?autoplay=1" class="no-style">
  429.                                         <div class="ytThumbContainer ytThumbContainer-small">
  430.                                             {% set mURL = "" %}
  431.                                             {% if post.getMedia() %}
  432.                                                 {% set mURL = post.getMedia().getURL() %}
  433.                                             {% endif %}
  434.                                             {{ post.getVideoMediaTag("","max-height:165px;", false, false, true, mURL)|raw }}
  435.                                         </div>
  436.                                     </a>
  437.                                 {% elseif post.getFeaturedImageTag() is not empty %}
  438.                                     {{ post.getFeaturedImageTag("","")|raw }}
  439.                                 {% endif %}
  440.                             </div>
  441.                             <div class="col-9">
  442.                             {# <div class={{ post.getFeaturedImageTag() is empty or  post.getVideoMediaTag("","", false)|raw is empty   ? "col-12" : "col-9" }}> #}
  443.                                 <h3 class="list-post-title">{{ post.title }}</h3>
  444.                                 <p>{{ post.getIntroText() }}<br>
  445.                                     <a class="readmore" href="{{ post.getFullURL(site_code) }}">View the Classified</a>
  446.                                 </p>
  447.                             </div>
  448.                         </div>
  449.                     {% endfor %}
  450.                     {% if customer.getClassifieds()|length > 3 %}
  451.                         <div class="row">
  452.                             <div class="col-3"></div>
  453.                             <div class="col-9">
  454.                                 <a class="readmore" href="{{ meta.root }}/content/{{ constant("App\\Entity\\Content::CLASSIFIED") }}">
  455.                                     <strong>
  456.                                         See More</strong>
  457.                                 </a>
  458.                             </div>
  459.                         </div>
  460.                     {% endif %}
  461.                 </div>
  462.             {% endif %}
  463.             {# Buy Online #}
  464.             {% if show_buy_online and buy_online_posts is not empty %}
  465.                 <hr>
  466.                 <div>
  467.                     <h2>
  468.                         <strong>Buy Online</strong>
  469.                     </h2>
  470.                     {% for post in buy_online_posts|slice(0, 3) %}
  471.                         <div class="row list-row">
  472.                             {% if post.getFeaturedImageTag() is not empty %}
  473.                                 <div class="col-3 post-thumbnail directoryitem">
  474.                                     {{ post.getFeaturedImageTag()|raw }}
  475.                                 </div>
  476.                             {% endif %}
  477.                             <div class={{ (post.getFeaturedImageTag() is empty) ? "col-12" : "col-9" }}>
  478.                                 <p>{{ post.getIntroText() }}<br>
  479.                                     <a class="readmore" href="{{ post.getFullURL(site_code) }}">Read More</a>
  480.                                 </p>
  481.                             </div>
  482.                         </div>
  483.                     {% endfor %}
  484.                     {% if buy_online_posts|length > 3 %}
  485.                         <div class="row">
  486.                             <div class="col-3"></div>
  487.                             <div class="col-9">
  488.                                 <a class="readmore" href="{{ meta.root }}/content/buy-online">
  489.                                     <strong>
  490.                                         See More</strong>
  491.                                 </a>
  492.                             </div>
  493.                         </div>
  494.                     {% endif %}
  495.                 </div>
  496.             {% endif %}
  497.             {# Products #}
  498.             {% if show_products and customer.getGiftStoreProducts() is not empty %}
  499.                 <hr>
  500.                 <div>
  501.                     <h2>
  502.                         <strong>Latest Products</strong>
  503.                     </h2>
  504.                     {% for product in customer.getGiftStoreProducts()|slice(0, 3) %}
  505.                         <div class="row list-row">
  506.                             {% if product.getFeaturedImageTag() is not empty %}
  507.                                 <div class="col-3 post-thumbnail directoryitem">
  508.                                     {{ product.getFeaturedImageTag()|raw }}
  509.                                 </div>
  510.                             {% endif %}
  511.                             <div class={{ (product.getFeaturedImageTag() is empty) ? "col-12" : "col-9" }}>
  512.                                 <h3 class="list-post-title">{{ product.title }}</h3>
  513.                                 <p>{{ product.getIntroText() }}<br>
  514.                                     <a class="readmore" href="{{product.getURL()}}/{{customer.getId()}}">View Product</a>
  515.                                 </p>
  516.                             </div>
  517.                         </div>
  518.                     {% endfor %}
  519.                     {% if customer.getGiftStoreProducts()|length > 3 %}
  520.                         <div class="row">
  521.                             <div class="col-3"></div>
  522.                             <div class="col-9">
  523.                                 <a class="readmore" href="/gift-shop/1/_/{{customer.getId()}}">
  524.                                     <strong>
  525.                                         See More</strong>
  526.                                 </a>
  527.                             </div>
  528.                         </div>
  529.                     {% endif %}
  530.                 </div>
  531.             {% endif %}
  532.             {# Partner Videos #}
  533.             {#
  534.                                                                             {% if show_video and video_posts is not empty %}
  535.                                                                                 <hr>
  536.                                                                                 <div>
  537.                                                                                     <h2><strong>Partner Videos</strong></h2>
  538.                                                                                     {% for post in video_posts %}
  539.                                                                                         <div class="row list-row">
  540.                                                                                             {% if post.getFeaturedImageTag() is not empty %}
  541.                                                                                                 <div class="col-3 post-thumbnail directoryitem">
  542.                                                                                                     {{ post.getFeaturedImageTag()|raw }}
  543.                                                                                                 </div>
  544.                                                                                             {% endif %}
  545.                                                                                             <div class={{ (post.getFeaturedImageTag() is empty) ? "col-12" : "col-9" }}>
  546.                                                                                                 {{ post.getContentFull() | wordpress | raw }}
  547.                                                                                             </div>
  548.                                                                                         </div>
  549.                                                                                     {% endfor %}
  550.                                                                                 </div>
  551.                                                                             {% endif %}
  552.                                                                             #}
  553.             {# Partner Videos #}
  554.                 {% if show_video and customer.getVideos() is not empty %}
  555.                 <hr>
  556.                     <div>
  557.                         <h2>
  558.                             <strong>
  559.                         Latest Videos
  560.                     </strong>
  561.                     </h2>
  562.                         {% for post in customer.getVideos()|slice(0, 3) %}
  563.                             <div class="row list-row"> {% if post.getFeaturedImageTag() is not empty %}
  564.                                 <div class="col-3 post-thumbnail directoryitem">
  565.                                     {{ post.getFeaturedImageTag()|raw }}
  566.                                 </div>
  567.                             {% endif %}
  568.                             <div class={{ (post.getFeaturedImageTag() is empty) ? "col-12" : "col-9" }}>
  569.                                 <h3 class="list-post-title">{{ post.title }}</h3>
  570.                                 <p>{{ post.getIntroText() }}<br>
  571.                                     <a class="readmore" href="{{ post.getFullURL(site_code) }}">View Video</a>
  572.                                 </p>
  573.                             </div>
  574.                         </div>
  575.                     {% endfor %}
  576.                     {% if customer.getVideos()|length > 3 %}
  577.                         <div class="row">
  578.                             <div class="col-3"></div>
  579.                             <div class="col-9">
  580.                                 <a class="readmore" href="{{ meta.root }}/content/{{ constant("App\\Entity\\Content::VIDEO") }}">
  581.                                     <strong>
  582.                                         See More</strong>
  583.                                 </a>
  584.                             </div>
  585.                         </div>
  586.                     {% endif %}
  587.                 </div>
  588.             {% endif %}
  589.             {% if show_photos %}
  590.                 {% set preview_gallery = customer.getFirstPartnerGalleryMediaGroup() %}
  591.                 {#{% if customer.photogallery is not null and customer.photogallery.mediagroupitems is not empty %}#}
  592.                 {#{% if customer.getFirstPartnerGalleryMediaGroup() is not null and customer.getFirstPartnerGalleryMediaGroup() is not empty %}#}
  593.                 {% if preview_gallery is not null and preview_gallery.mediagroupitems is not empty %}
  594.                     <hr>
  595.                     <div>
  596.                         <h2>
  597.                             <strong>Partner Photo Gallery</strong>
  598.                         </h2>
  599.                         <div class="" id="thumb-holder">
  600.                             <ul id="thumbs">
  601.                                 {% for photo in preview_gallery.getMediaGroupItemsForDirectoryPreview() %}
  602.                                     {% if photo.media is not null %}
  603.                                         <li>
  604.                                             <a href="{{ photo.media.getURL() }}">{{ photo.media.getImageTag("","","","", false)|raw }}</a>
  605.                                         </li>
  606.                                     {% endif %}
  607.                                 {% endfor %}
  608.                             </ul>
  609.                         </div>
  610.                     </div>
  611.                 {% elseif customer.getContentsByType(constant("App\\Entity\\Content::GALLERY")) is not empty %}
  612.                     <hr>
  613.                 {% endif %}
  614.                 {% if customer.getContentsByType(constant("App\\Entity\\Content::GALLERY")) is not empty %}
  615.                     {# Will there only be one? #}
  616.                     {% set gallery = customer.getContentsByType(constant("App\\Entity\\Content::GALLERY")).first() %}
  617.                     <a class="readmore" href="{{ gallery.getFullURL(site_code) }}"><br>View Full Gallery</a>
  618.                 {% endif %}
  619.             {% endif %}
  620.             {# Video Gallery #}
  621.         {% endif %}
  622.         {# customer not empty #}
  623.     </div>
  624.     <script>
  625.         (function ($) {
  626. $(function () {
  627. $('[data-video-row]').each(function () { // $video = $(this).find('video').first();
  628. $(this).on('mouseover', function () {
  629. $(this).find('video').first()[0].play();
  630. $(this).find('.ytThumbContainer').first().stop(true, true).addClass('ytThumbContainer-playing', 500);
  631. // console.log($video);
  632. // console.log($(this).attr("data-video-row"));
  633. });
  634. $(this).on('mouseleave', function () {
  635. // $(this).find('video').first()[0].pause();
  636. // $(this).find('video').first()[0].currentTime=0;
  637. $(this).find('video').first()[0].load();
  638. $(this).find('.ytThumbContainer').first().stop(true, true).removeClass('ytThumbContainer-playing', 100);
  639. });
  640. });
  641. /*    
  642.             
  643.             
  644.             $('#user-dashboard-container').on('click', '#addNote', function() {
  645.                 $("#contactNotes").append(noteHtml.join(''));
  646.                 $("#updateNotes").show();
  647.             });
  648.             
  649.             $('#user-dashboard-container').on('click', '.deleteNote', function() {
  650.                 $(this).parent().parent().remove();
  651.             });
  652.             */
  653. });
  654. }(jQuery));
  655.     </script>
  656. {% endblock %}
  657. {% block sidebar %}
  658.     {% include "sidebars/directory.html.twig" %}
  659. {% endblock %}