templates/content/tmpl/ebooks.html.twig line 1

Open in your IDE?
  1. {% extends "1-col-sidebar.html.twig" %}
  2. {% block column %}
  3.     {% if site_code == constant("App\\Entity\\Content::SITE_RCS") %}
  4.         {% include "includes/curtain-ads/rlw.html.twig" %}
  5.     {% endif %}
  6.     {% if content is defined %}
  7.         {% if content.getShowTitle() %}
  8.             <div class="row">
  9.                 <h1>{{ content.getTitle() | raw }}</h1>
  10.                 {% include "includes/ebooks-sort-select.html.twig" %}
  11.             </div>
  12.         {% endif %}
  13.         {% if content.getFeaturedImageTag() %}
  14.             {{ content.getFeaturedImageTag("display-block","")|raw }}
  15.         {% endif %}
  16.         {% if content.getContentFull() is not empty %}
  17.             {{ content.getContentFull() | wordpress | raw }}
  18.         {% endif %}
  19.     {% endif %}
  20.     <style>
  21.         h1 {
  22.             display: inline-block
  23.         }
  24.         .row {
  25.             display: flex;
  26.             flex-direction: row;
  27.             /*justify-content: space-between;*/
  28.         }
  29.         .column {
  30.             justify-content: center;
  31.             display: flex;
  32.             flex-direction: column;
  33.         }
  34.         .book {
  35.             height: 288px;
  36.             margin: auto;
  37.             box-shadow: 5px 4px 6px 2px #0000006e;
  38.             position: relative;
  39.             transition: 0.2s ease-in-out;
  40.             width: 223px;
  41.             overflow: hidden;
  42.         }
  43.         .book:hover {
  44.             box-shadow: 0 12px 15px -2px #0000006e;
  45.             padding: 0;
  46.             transform: scale(1.05);
  47.         }
  48.         .book:hover > .title {
  49.             bottom: 15px;
  50.         }
  51.         .title {
  52.             /*position: absolute;*/
  53.             bottom: -6px;
  54.             left: 0;
  55.             width: 100%;
  56.             text-align: center;
  57.             font-weight: bolder;
  58.             transition: 0.2s ease-in-out;
  59.             padding: 0 10px;
  60.         }
  61.         .book-container {
  62.             margin-top: 20px;
  63.             margin-bottom: 14px;
  64.         }
  65.         .cover-art {
  66.             max-height: 288px;
  67.             margin: auto;
  68.             display: block;
  69.         }
  70.     </style>
  71.     {% if customers is defined %}
  72.         <div class="row">
  73.             {% for customer in customers %}
  74.                 <a class="col-lg-4 col-md-6 " href="/ebooks-by/{{customer.getDirectoryContent().getSlug()}}">
  75.                     <div class="book-container">
  76.                         <div class="book">
  77.                             {{random(customer.getLatestContent(19, 0)).getMedia().getImageTag('cover-art')|raw}}
  78.                         </div>
  79.                     </div>
  80.                     <div class="title">{{customer}}</div>
  81.                 </a>
  82.             {% endfor %}
  83.         </div>
  84.     {% elseif categories is defined %}
  85.         <div class="row">
  86.             {% for category in categories %}
  87.                 <a class="col-lg-4 col-md-6 " href="/category/ebooks/{{category.getSlug()}}">
  88.                     <div class="book-container">
  89.                         <div class="book">
  90.                             {# Business & Industry #}
  91.                             {% if category.getMedia() %}
  92.                                 <img src="{{category.getMedia().getURL()}}" class="cover-art" loading="lazy">
  93.                             {% elseif category.getId() == 1309 and site_code == constant("App\\Entity\\Content::SITE_RCS") %}
  94.                                 <img src="https://www.rooferscoffeeshop.com/uploads/media/2023/07/ebook-business-industry.png" class="cover-art" loading="lazy">
  95.                             {% elseif category.getId() == 1309 and site_code == constant("App\\Entity\\Content::SITE_CCS") %}
  96.                                 <img src="https://www.rooferscoffeeshop.com/uploads/media/2023/07/ccs-ebook-business-industry.png" class="cover-art" loading="lazy">
  97.                             {# Catalogs #}
  98.                             {% elseif category.getId() == 1313 and site_code == constant("App\\Entity\\Content::SITE_RCS") %}
  99.                                 <img src="https://www.rooferscoffeeshop.com/uploads/media/2023/07/ebook-catalogs.png" class="cover-art" loading="lazy">
  100.                             {% elseif category.getId() == 1313 and site_code == constant("App\\Entity\\Content::SITE_CCS") %}
  101.                                 <img src="https://www.rooferscoffeeshop.com/uploads/media/2023/07/ccs-ebook-catalogs.png" class="cover-art" loading="lazy">
  102.                             {# Design #}
  103.                             {% elseif category.getId() == 1312 and site_code == constant("App\\Entity\\Content::SITE_RCS") %}
  104.                                 <img src="https://www.rooferscoffeeshop.com/uploads/media/2023/07/ebook-design.png" class="cover-art" loading="lazy">
  105.                             {% elseif category.getId() == 1312 and site_code == constant("App\\Entity\\Content::SITE_CCS") %}
  106.                                 <img src="https://www.rooferscoffeeshop.com/uploads/media/2023/07/ccs-ebook-design.png" class="cover-art" loading="lazy">
  107.                             {# Homeowner #}
  108.                             {% elseif category.getId() == 1369 and site_code == constant("App\\Entity\\Content::SITE_CCS") %}
  109.                                 <img src="https://www.rooferscoffeeshop.com/uploads/media/2023/07/ccs-ebook-homeowner.png" class="cover-art" loading="lazy">
  110.                             {# Materials & Install #}
  111.                             {% elseif category.getId() == 1310 and site_code == constant("App\\Entity\\Content::SITE_RCS") %}
  112.                                 <img src="https://www.rooferscoffeeshop.com/uploads/media/2023/07/ebook-materials-install.png" class="cover-art" loading="lazy">
  113.                             {% elseif category.getId() == 1310 and site_code == constant("App\\Entity\\Content::SITE_CCS") %}
  114.                                 <img src="https://www.rooferscoffeeshop.com/uploads/media/2023/07/ccs-ebook-materials-install.png" class="cover-art" loading="lazy">
  115.                             {# Tech & Software #}
  116.                             {% elseif category.getId() == 1311 and site_code == constant("App\\Entity\\Content::SITE_RCS") %}
  117.                                 <img src="https://www.rooferscoffeeshop.com/uploads/media/2023/07/ebook-tech-software.png" class="cover-art" loading="lazy">
  118.                             {% elseif category.getId() == 1311 and site_code == constant("App\\Entity\\Content::SITE_CCS") %}
  119.                                 <img src="https://www.rooferscoffeeshop.com/uploads/media/2023/07/ccs-ebook-tech-software.png" class="cover-art" loading="lazy">
  120.                             {% else %}
  121.                                 {{(category.getPinnedEbook(site_code)).getMedia().getImageTag('cover-art')|raw}}
  122.                             {% endif %}
  123.                         </div>
  124.                     </div>
  125.                     <div class="title">{{category}}</div>
  126.                 </a>
  127.             {% endfor %}
  128.         </div>
  129.     {% else %}
  130.         <div class="row">
  131.             {% for eBook in eBooks %}
  132.                 <a class="col-lg-4 col-md-6 " href="/ebooks/{{eBook.getSlug()}}">
  133.                     <div class="book-container">
  134.                         <div class="book">
  135.                             {{eBook.getMedia().getImageTag('cover-art')|raw}}
  136.                         </div>
  137.                     </div>
  138.                     <div class="title">{{eBook.getTitle()}}</div>
  139.                 </a>
  140.             {% endfor %}
  141.         </div>
  142.     {% endif %}
  143. {% endblock %}