{% extends "1-col-sidebar.html.twig" %}
{# directory listing #}
{% set customer = content.getDirectory() %}
{% block column %}
{% if site_code is not defined %}
{% set site_code = '' %}
{% endif %}
<script src="{{ asset("assets/js/directory-listing.min.js?v=3") }}"></script>
<div class="directory-listing">
<a href="/our-directory" class="button alt" style="float: right;">Back to Directory</a><br><br>
{% if content.getShowTitle() %}
<h1 class="post-title notranslate directory-title">{{ content.getTitle() }}</h1>
{% endif %}
<div>
{{ content.getContentFull()|wordpress|raw }}
</div>
{% if customer is not empty %}
{# Promos and Rebates #}
{% if show_promotions and customer.getPromosRebates() is not empty %}
<hr>
<div>
<h2>
<strong>Latest Promotions and Rebates</strong>
</h2>
{% for post in customer.getPromosRebates()|slice(0, 3) %}
<div class="row list-row">
{% if post.getFeaturedImageTag() is not empty %}
<div class="col-3 post-thumbnail directoryitem">
{{ post.getFeaturedImageTag()|raw }}
</div>
{% endif %}
<div class={{ (post.getFeaturedImageTag() is empty) ? "col-12" : "col-9" }}>
<h3 class="list-post-title">{{ post.title }}</h3>
<p>{{ post.getIntroText() }}<br>
<a class="readmore" href="{{ post.getFullURL(site_code) }}">View Promotion</a>
</p>
</div>
</div>
{% endfor %}
{% if customer.getPromosRebates()|length > 3 %}
<div class="row">
<div class="col-3"></div>
<div class="col-9">
<a class="readmore" href="{{ meta.root }}/content/{{ constant("App\\Entity\\Content::PROMOS_REBATES") }}">
<strong>
See More</strong>
</a>
</div>
</div>
{% endif %}
</div>
{% endif %}
{% set ebooks = customer.getEbooks(200) %}
{# Ebooks #}
{% if show_ebooks and ebooks is not empty %}
<hr>
<div>
<h2>
<strong>eBooks</strong>
</h2>
{% set reBooks = ebooks|shuffle %}
{% for post in reBooks|slice(0, 3) %}
<div class="row list-row">
{% if post.getFeaturedImageTag() is not empty %}
<div class="col-3 post-thumbnail directoryitem">
{{ post.getFeaturedImageTag()|raw }}
</div>
{% endif %}
<div class={{ (post.getFeaturedImageTag() is empty) ? "col-12" : "col-9" }}>
<h3 class="list-post-title">{{ post.title }}</h3>
<p>{{ post.getIntroText() }}<br>
<a class="readmore" href="{{ post.getFullURL(site_code) }}">View eBook</a>
</p>
</div>
</div>
{% endfor %}
{% if ebooks|length > 3 %}
<div class="row">
<div class="col-3"></div>
<div class="col-9">
<a class="readmore" href="{{ meta.root }}/content/{{ constant("App\\Entity\\Content::EBOOK") }}">
<strong>
See More</strong>
</a>
</div>
</div>
{% endif %}
</div>
{% endif %}
{# Contests and Games #}
{% if show_contestgames and customer.getContestsGames() is not empty %}
<hr>
<div>
<h2>
<strong>Latest Contests and Games</strong>
</h2>
{% for post in customer.getContestsGames()|slice(0, 3) %}
<div class="row list-row">
{% if post.getFeaturedImageTag() is not empty %}
<div class="col-3 post-thumbnail directoryitem">
{{ post.getFeaturedImageTag()|raw }}
</div>
{% endif %}
<div class={{ (post.getFeaturedImageTag() is empty) ? "col-12" : "col-9" }}>
<h3 class="list-post-title">{{ post.title }}</h3>
<p>{{ post.getIntroText() }}<br>
<a class="readmore" href="{{ post.getFullURL(site_code) }}">View Contest or Game</a>
</p>
</div>
</div>
{% endfor %}
{% if customer.getContestsGames()|length > 3 %}
<div class="row">
<div class="col-3"></div>
<div class="col-9">
<a class="readmore" href="{{ meta.root }}/content/{{ constant("App\\Entity\\Content::CONTEST_GAMES") }}">
<strong>
See More</strong>
</a>
</div>
</div>
{% endif %}
</div>
{% endif %}
{# Awards #}
{% if show_awards and customer.getAwards() is not empty %}
<hr>
<div>
<h2>
<strong>Latest Awards</strong>
</h2>
{% for post in customer.getAwards()|slice(0, 3) %}
<div class="row list-row">
{% if post.getFeaturedImageTag() is not empty %}
<div class="col-3 post-thumbnail directoryitem">
{{ post.getFeaturedImageTag()|raw }}
</div>
{% endif %}
<div class={{ (post.getFeaturedImageTag() is empty) ? "col-12" : "col-9" }}>
<h3 class="list-post-title">{{ post.title }}</h3>
<p>{{ post.getIntroText() }}<br>
<a class="readmore" href="{{ post.getFullURL(site_code) }}">View Award</a>
</p>
</div>
</div>
{% endfor %}
{% if customer.getAwards()|length > 3 %}
<div class="row">
<div class="col-3"></div>
<div class="col-9">
<a class="readmore" href="{{ meta.root }}/content/{{ constant("App\\Entity\\Content::AWARD") }}">
<strong>
See More</strong>
</a>
</div>
</div>
{% endif %}
</div>
{% endif %}
{# Scholarships #}
{% if show_scholarships and customer.getScholarships() is not empty %}
<hr>
<div>
<h2>
<strong>Latest Scholarships</strong>
</h2>
{% for post in customer.getScholarships()|slice(0, 3) %}
<div class="row list-row">
{% if post.getFeaturedImageTag() is not empty %}
<div class="col-3 post-thumbnail directoryitem">
{{ post.getFeaturedImageTag()|raw }}
</div>
{% endif %}
<div class={{ (post.getFeaturedImageTag() is empty) ? "col-12" : "col-9" }}>
<h3 class="list-post-title">{{ post.title }}</h3>
<p>{{ post.getIntroText() }}<br>
<a class="readmore" href="{{ post.getFullURL(site_code) }}">View Scholarship</a>
</p>
</div>
</div>
{% endfor %}
{% if customer.getScholarships()|length > 3 %}
<div class="row">
<div class="col-3"></div>
<div class="col-9">
<a class="readmore" href="{{ meta.root }}/content/{{ constant("App\\Entity\\Content::SCHOLARSHIP") }}">
<strong>
See More</strong>
</a>
</div>
</div>
{% endif %}
</div>
{% endif %}
{# Spanish Content #}
{% if spanish_content is not empty %}
<hr>
<div>
<h2>
<strong>Latest Spanish Content</strong>
</h2>
{% for post in spanish_content|slice(0, 3) %}
<div class="row list-row">
{% if post.getFeaturedImageTag() is not empty %}
<div class="col-3 post-thumbnail directoryitem">
{{ post.getFeaturedImageTag()|raw }}
</div>
{% endif %}
<div class={{ (post.getFeaturedImageTag() is empty) ? "col-12" : "col-8" }}>
<h3 class="list-post-title">{{ post.title }}</h3>
<p>{{ post.getIntroText() }}<br>
<a class="readmore" href="{{ post.getFullURL(site_code) }}">View Content</a>
</p>
</div>
</div>
{% endfor %}
{% if spanish_content|length > 3 %}
<div class="row">
<div class="col-3"></div>
<div class="col-9">
<a class="readmore" href="{{ meta.root }}/content/spanish">
<strong>
See More</strong>
</a>
</div>
</div>
{% endif %}
</div>
{% endif %}
{# International Content #}
{% if int_content is not empty %}
<hr>
<div>
<h2>
<strong>Latest International Content</strong>
</h2>
{% for post in int_content|slice(0, 3) %}
<div class="row list-row">
{% if post.getFeaturedImageTag() is not empty %}
<div class="col-3 post-thumbnail directoryitem">
{{ post.getFeaturedImageTag()|raw }}
</div>
{% endif %}
<div class={{ (post.getFeaturedImageTag() is empty) ? "col-12" : "col-8" }}>
<h3 class="list-post-title">{{ post.title }}</h3>
<p>{{ post.getIntroText() }}<br>
<a class="readmore" href="{{ post.getFullURL(site_code) }}">View Content</a>
</p>
</div>
</div>
{% endfor %}
{% if int_content|length > 3 %}
<div class="row">
<div class="col-3"></div>
<div class="col-9">
<a class="readmore" href="{{ meta.root }}/content/international">
<strong>
See More</strong>
</a>
</div>
</div>
{% endif %}
</div>
{% endif %}
{# Canada Content #}
{% if canada_content is not empty %}
<hr>
<div>
<h2>
<strong>Latest Canada Content</strong>
</h2>
{% for post in canada_content|slice(0, 3) %}
<div class="row list-row">
{% if post.getFeaturedImageTag() is not empty %}
<div class="col-3 post-thumbnail directoryitem">
{{ post.getFeaturedImageTag()|raw }}
</div>
{% endif %}
<div class={{ (post.getFeaturedImageTag() is empty) ? "col-12" : "col-8" }}>
<h3 class="list-post-title">{{ post.title }}</h3>
<p>{{ post.getIntroText() }}<br>
<a class="readmore" href="{{ post.getFullURL(site_code) }}">View Content</a>
</p>
</div>
</div>
{% endfor %}
{% if canada_content|length > 3 %}
<div class="row">
<div class="col-3"></div>
<div class="col-9">
<a class="readmore" href="{{ meta.root }}/content/canada">
<strong>
See More</strong>
</a>
</div>
</div>
{% endif %}
</div>
{% endif %}
{# Podcasts #}
{% if show_podcasts and customer.getPodcasts() is not empty %}
<hr>
<div>
<h2>
<strong>Latest Podcasts</strong>
</h2>
{% for post in customer.getPodcasts()|slice(0, 3) %}
<div class="row list-row">
{% if post.getFeaturedImageTag() is not empty %}
<div class="col-3 post-thumbnail directoryitem">
{{ post.getFeaturedImageTag()|raw }}
</div>
{% endif %}
<div class={{ (post.getFeaturedImageTag() is empty) ? "col-12" : "col-8" }}>
<h3 class="list-post-title">{{ post.title }}</h3>
<p>{{ post.getIntroText() }}<br>
<a class="readmore" href="{{ post.getFullURL(site_code) }}">Listen to the Podcast</a>
</p>
</div>
</div>
{% endfor %}
{% if customer.getPodcasts()|length > 3 %}
<div class="row">
<div class="col-3"></div>
<div class="col-9">
<a class="readmore" href="{{ meta.root }}/content/{{ constant("App\\Entity\\Content::PODCAST") }}">
<strong>
Listen More</strong>
</a>
</div>
</div>
{% endif %}
</div>
{% endif %}
{# Webinars #}
{% if show_webinars and customer.getWebinars() is not empty %}
<hr>
<div>
<h2>
<strong>Latest Webinars</strong>
</h2>
{% for post in customer.getWebinars()|slice(0, 3) %}
<div class="row list-row">
{% if post.getFeaturedImageTag() is not empty %}
<div class="col-3 post-thumbnail directoryitem">
{{ post.getFeaturedImageTag()|raw }}
</div>
{% endif %}
<div class={{ (post.getFeaturedImageTag() is empty) ? "col-12" : "col-9" }}>
<h3 class="list-post-title">{{ post.title }}</h3>
<p>{{ post.getIntroText() }}<br>
<a class="readmore" href="{{ post.getFullURL(site_code) }}">Watch the Webinar</a>
</p>
</div>
</div>
{% endfor %}
{% if customer.getWebinars()|length > 3 %}
<div class="row">
<div class="col-3"></div>
<div class="col-9">
<a class="readmore" href="{{ meta.root }}/content/{{ constant("App\\Entity\\Content::WEBINAR") }}">
<strong>
See More</strong>
</a>
</div>
</div>
{% endif %}
</div>
{% endif %}
{# Educational Content (TheHUB) #}
{% if show_education and customer.getHUBContent() is not empty %}
<hr>
<div>
<h2>
<strong>Read Listen Watch - Educational Content</strong>
</h2>
{% for post in customer.getHUBContent()|slice(0, 3) %}
<div class="row list-row">
{% if post.getFeaturedImageTag() is not empty %}
<div class="col-3 post-thumbnail directoryitem">
{{ post.getFeaturedImageTag()|raw }}
</div>
{% endif %}
<div class={{ (post.getFeaturedImageTag() is empty) ? "col-12" : "col-9" }}>
<h3 class="list-post-title">{{ post.title }}</h3>
{# <p>{{ post.contentfull|snippet(320) }}<br> #}
<p>{{ post.getIntroText() }}<br>
<a class="readmore" href="{{ post.getFullURL(site_code) }}">View Content</a>
</p>
</div>
</div>
{% endfor %}
{% if customer.getHUBContent()|length > 3 %}
<div class="row">
<div class="col-3"></div>
<div class="col-9">
<a class="readmore" href="{{ meta.root }}/content/{{ constant("App\\Entity\\Content::THE_HUB") }}">
<strong>
See More</strong>
</a>
</div>
</div>
{% endif %}
</div>
{% endif %}
{# Classifieds #}
{% if show_classifieds and customer.getClassifieds() is not empty %}
<hr>
<div>
<h2>
<strong>Latest Classifieds</strong>
</h2>
{% for post in customer.getClassifieds()|slice(0, 3) %}
<div
style="height: 200px;" class="row list-row" {% if post.getVideoMedia() %} data-video-row="{{post.getVideoMedia().getId()}}" {% endif %}>
{# {% if post.getFeaturedImageTag() is not empty %}
<div class="col-3 post-thumbnail directoryitem">
{% if post.hasVideoMedia() %}
{{ post.getVideoMediaTag("","", false)|raw }}
{% elseif post.getFeaturedImageTag() is not empty %}
{{ post.getFeaturedImageTag("","")|raw }}
{% endif %}
</div>
{% endif %} #}
<div class="col-sm-2 post-thumbnail directoryitem">
{% if post.hasVideoMedia() %}
<a href="{{ post.getURL() }}?autoplay=1" class="no-style">
<div class="ytThumbContainer ytThumbContainer-small">
{% set mURL = "" %}
{% if post.getMedia() %}
{% set mURL = post.getMedia().getURL() %}
{% endif %}
{{ post.getVideoMediaTag("","max-height:165px;", false, false, true, mURL)|raw }}
</div>
</a>
{% elseif post.getFeaturedImageTag() is not empty %}
{{ post.getFeaturedImageTag("","")|raw }}
{% endif %}
</div>
<div class="col-9">
{# <div class={{ post.getFeaturedImageTag() is empty or post.getVideoMediaTag("","", false)|raw is empty ? "col-12" : "col-9" }}> #}
<h3 class="list-post-title">{{ post.title }}</h3>
<p>{{ post.getIntroText() }}<br>
<a class="readmore" href="{{ post.getFullURL(site_code) }}">View the Classified</a>
</p>
</div>
</div>
{% endfor %}
{% if customer.getClassifieds()|length > 3 %}
<div class="row">
<div class="col-3"></div>
<div class="col-9">
<a class="readmore" href="{{ meta.root }}/content/{{ constant("App\\Entity\\Content::CLASSIFIED") }}">
<strong>
See More</strong>
</a>
</div>
</div>
{% endif %}
</div>
{% endif %}
{# Buy Online #}
{% if show_buy_online and buy_online_posts is not empty %}
<hr>
<div>
<h2>
<strong>Buy Online</strong>
</h2>
{% for post in buy_online_posts|slice(0, 3) %}
<div class="row list-row">
{% if post.getFeaturedImageTag() is not empty %}
<div class="col-3 post-thumbnail directoryitem">
{{ post.getFeaturedImageTag()|raw }}
</div>
{% endif %}
<div class={{ (post.getFeaturedImageTag() is empty) ? "col-12" : "col-9" }}>
<p>{{ post.getIntroText() }}<br>
<a class="readmore" href="{{ post.getFullURL(site_code) }}">Read More</a>
</p>
</div>
</div>
{% endfor %}
{% if buy_online_posts|length > 3 %}
<div class="row">
<div class="col-3"></div>
<div class="col-9">
<a class="readmore" href="{{ meta.root }}/content/buy-online">
<strong>
See More</strong>
</a>
</div>
</div>
{% endif %}
</div>
{% endif %}
{# Products #}
{% if show_products and customer.getGiftStoreProducts() is not empty %}
<hr>
<div>
<h2>
<strong>Latest Products</strong>
</h2>
{% for product in customer.getGiftStoreProducts()|slice(0, 3) %}
<div class="row list-row">
{% if product.getFeaturedImageTag() is not empty %}
<div class="col-3 post-thumbnail directoryitem">
{{ product.getFeaturedImageTag()|raw }}
</div>
{% endif %}
<div class={{ (product.getFeaturedImageTag() is empty) ? "col-12" : "col-9" }}>
<h3 class="list-post-title">{{ product.title }}</h3>
<p>{{ product.getIntroText() }}<br>
<a class="readmore" href="{{product.getURL()}}/{{customer.getId()}}">View Product</a>
</p>
</div>
</div>
{% endfor %}
{% if customer.getGiftStoreProducts()|length > 3 %}
<div class="row">
<div class="col-3"></div>
<div class="col-9">
<a class="readmore" href="/gift-shop/1/_/{{customer.getId()}}">
<strong>
See More</strong>
</a>
</div>
</div>
{% endif %}
</div>
{% endif %}
{# Partner Videos #}
{#
{% if show_video and video_posts is not empty %}
<hr>
<div>
<h2><strong>Partner Videos</strong></h2>
{% for post in video_posts %}
<div class="row list-row">
{% if post.getFeaturedImageTag() is not empty %}
<div class="col-3 post-thumbnail directoryitem">
{{ post.getFeaturedImageTag()|raw }}
</div>
{% endif %}
<div class={{ (post.getFeaturedImageTag() is empty) ? "col-12" : "col-9" }}>
{{ post.getContentFull() | wordpress | raw }}
</div>
</div>
{% endfor %}
</div>
{% endif %}
#}
{# Partner Videos #}
{% if show_video and customer.getVideos() is not empty %}
<hr>
<div>
<h2>
<strong>
Latest Videos
</strong>
</h2>
{% for post in customer.getVideos()|slice(0, 3) %}
<div class="row list-row"> {% if post.getFeaturedImageTag() is not empty %}
<div class="col-3 post-thumbnail directoryitem">
{{ post.getFeaturedImageTag()|raw }}
</div>
{% endif %}
<div class={{ (post.getFeaturedImageTag() is empty) ? "col-12" : "col-9" }}>
<h3 class="list-post-title">{{ post.title }}</h3>
<p>{{ post.getIntroText() }}<br>
<a class="readmore" href="{{ post.getFullURL(site_code) }}">View Video</a>
</p>
</div>
</div>
{% endfor %}
{% if customer.getVideos()|length > 3 %}
<div class="row">
<div class="col-3"></div>
<div class="col-9">
<a class="readmore" href="{{ meta.root }}/content/{{ constant("App\\Entity\\Content::VIDEO") }}">
<strong>
See More</strong>
</a>
</div>
</div>
{% endif %}
</div>
{% endif %}
{% if show_photos %}
{% set preview_gallery = customer.getFirstPartnerGalleryMediaGroup() %}
{#{% if customer.photogallery is not null and customer.photogallery.mediagroupitems is not empty %}#}
{#{% if customer.getFirstPartnerGalleryMediaGroup() is not null and customer.getFirstPartnerGalleryMediaGroup() is not empty %}#}
{% if preview_gallery is not null and preview_gallery.mediagroupitems is not empty %}
<hr>
<div>
<h2>
<strong>Partner Photo Gallery</strong>
</h2>
<div class="" id="thumb-holder">
<ul id="thumbs">
{% for photo in preview_gallery.getMediaGroupItemsForDirectoryPreview() %}
{% if photo.media is not null %}
<li>
<a href="{{ photo.media.getURL() }}">{{ photo.media.getImageTag("","","","", false)|raw }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
</div>
{% elseif customer.getContentsByType(constant("App\\Entity\\Content::GALLERY")) is not empty %}
<hr>
{% endif %}
{% if customer.getContentsByType(constant("App\\Entity\\Content::GALLERY")) is not empty %}
{# Will there only be one? #}
{% set gallery = customer.getContentsByType(constant("App\\Entity\\Content::GALLERY")).first() %}
<a class="readmore" href="{{ gallery.getFullURL(site_code) }}"><br>View Full Gallery</a>
{% endif %}
{% endif %}
{# Video Gallery #}
{% endif %}
{# customer not empty #}
</div>
<script>
(function ($) {
$(function () {
$('[data-video-row]').each(function () { // $video = $(this).find('video').first();
$(this).on('mouseover', function () {
$(this).find('video').first()[0].play();
$(this).find('.ytThumbContainer').first().stop(true, true).addClass('ytThumbContainer-playing', 500);
// console.log($video);
// console.log($(this).attr("data-video-row"));
});
$(this).on('mouseleave', function () {
// $(this).find('video').first()[0].pause();
// $(this).find('video').first()[0].currentTime=0;
$(this).find('video').first()[0].load();
$(this).find('.ytThumbContainer').first().stop(true, true).removeClass('ytThumbContainer-playing', 100);
});
});
/*
$('#user-dashboard-container').on('click', '#addNote', function() {
$("#contactNotes").append(noteHtml.join(''));
$("#updateNotes").show();
});
$('#user-dashboard-container').on('click', '.deleteNote', function() {
$(this).parent().parent().remove();
});
*/
});
}(jQuery));
</script>
{% endblock %}
{% block sidebar %}
{% include "sidebars/directory.html.twig" %}
{% endblock %}