app/template/default/blog/list.twig line 1

Open in your IDE?
  1. {% extends 'default_frame.twig' %}
  2. {% block javascript %}
  3.     <script type="text/javascript">
  4.         $(function() {
  5.             $('.archive-link-div__year__ttl').click(function(event) {
  6.                 $(this).closest('.archive-link-div__year').toggleClass('active');
  7.             });
  8.         });
  9.     </script>    
  10. {% endblock %}
  11. {% block stylesheet %}
  12.     <style>
  13.         .pluginCMBblog .item_blog_image {
  14.             width: 100% !important;
  15.             height: 248px;
  16.             object-fit: cover;
  17.         }
  18.         .pluginCMBblog .figure__main_image{
  19.             margin: 0;
  20.             padding: 0;
  21.             display: grid;
  22.             justify-content: stretch;
  23.             align-items: flex-end;
  24.         }
  25.         .pluginCMBblog .item_blog_image,
  26.         .pluginCMBblog figcaption {
  27.             padding: 0;
  28.             grid-column: 1/2;
  29.             grid-row: 1/2;
  30.         }
  31.         .pluginCMBblog figcaption {
  32.             text-align: center;
  33.             padding: 0.4rem 2rem;
  34.             font-size: 1rem;
  35.             background-color: rgba(0,0,0,.7);
  36.             color: #fff;
  37.             overflow: hidden;
  38.             white-space: normal;
  39.             word-wrap: break-word;
  40.         }
  41.         .pluginCMBblog .ec-topicpath .ec-topicpath__item{
  42.             display: initial !important;
  43.         }
  44.         .blog_release_dc{
  45.             display: flex;
  46.             align-items: center;
  47.             justify-content: flex-start;
  48.             font-size: 1.4rem;
  49.             margin-top: 1rem;
  50.         }
  51.         .pluginCMBblog .list_blog_cat li {
  52.             display: initial !important;
  53.             letter-spacing: 0.2rem;
  54.         }
  55.         .pluginCMBblog .list_blog .list_category_link{
  56.             color: inherit;
  57.             padding:  0 1rem 0 0;
  58.         }
  59.         .pluginCMBblog .blog_category li:last-child .list_category_link{
  60.             border: none;
  61.         }
  62.         .pluginCMBblog .blog_category{
  63.             margin: 0;
  64.             padding: 0;
  65.             display: flex;
  66.             flex-wrap: wrap;
  67.         }
  68.         .pluginCMBblog .blog_category li{
  69.             display: initial;
  70.         }
  71.         .pluginCMBblog .blog_title_h3{
  72.             font-size: 18px !important;
  73.             line-height: 1.4;
  74.             margin-top: 10px;
  75.             margin-bottom: 1px;
  76.             word-break: break-word;
  77.             color: #2881c3;
  78.         }
  79.         .pluginCMBblog .blog_release_date {
  80.             padding-right: 1rem;
  81.             margin-right: 1rem;
  82.             position: relative;
  83.         }
  84.         .pluginCMBblog .blog_release_date:after {
  85.             content: "";
  86.             position: absolute;
  87.             right: 0;
  88.             top: 50%;
  89.             transform: translateY(-50%);
  90.             width: 1px;
  91.             height: 1em;
  92.             background-color: #ddd;
  93.         }
  94.         .w-100 {
  95.             width: 100%
  96.         }
  97.         .side-bar > div {
  98.             width: 90%;
  99.             margin:40px auto;
  100.         }
  101.         h5.tag-header {
  102.           padding: 1rem 2rem;
  103.           border-left: 4px solid #000;
  104.         }
  105.         .month-archive a {
  106.             text-decoration: underline;
  107.             display: block;
  108.             padding: 3px 27px;
  109.         }
  110.         .archive-link-div {
  111.             max-height: 600px;
  112.             overflow-y: scroll;
  113.         }
  114.         .archive-link-div::-webkit-scrollbar {
  115.             display: none;
  116.         }
  117.         @media screen and (max-width: 768px){
  118.             .pluginCMBblog .item_blog_image {
  119.                 width: 100% !important;
  120.                 height: 40vw;
  121.                 object-fit: cover;
  122.             }
  123.             .side-bar > div {
  124.                 width: 100%
  125.             }
  126.         }
  127.         @media only screen and (min-width: 768px) {
  128.             .side-bar {
  129.                 width: 280px;
  130.                 background-color: #f6f6f6;
  131.             }
  132.             .ec-role {
  133.                 display: flex;
  134.                 justify-content: flex-start
  135.             }
  136.             .mt-65 {
  137.                 margin-top: 65px!important;
  138.             }
  139.         }
  140.     </style>
  141. {% endblock %}
  142. {% block main %}
  143.     <div class="ec-banner">
  144.         <div class="ec-banner__inner">
  145.             <div class="inner">
  146.                 <h2>
  147.                     {% if page_title ?? false %}
  148.                         {{ page_title }}
  149.                     {% else %}
  150.                         コラム    
  151.                     {% endif %}
  152.                 </h2>
  153.             </div>
  154.         </div>
  155.         <div class="ec-breadcrumb">
  156.             <ul class="ec-breadcrumb__menu">
  157.                 <li class="ec-breadcrumb__item"><a href="{{ url('homepage') }}">TOP</a></li>
  158.                 <li class="ec-breadcrumb__item"><span>></span></li>
  159.                 <li class="ec-breadcrumb__item"><p>コラム</p></li>
  160.             </ul>
  161.         </div>
  162.     </div>
  163.     <div class="ec-role pluginCMBblog">
  164.         <div class="w-100">
  165.             <div class="ec-searchnavRole__topicpath">
  166.                 <ol class="ec-topicpath list_blog_cat">
  167.                     <li class="ec-topicpath__item">
  168.                         <a href="{{ url('cm_blog_pro_page_list') }}">{{ '全て'|trans }}</a>
  169.                     </li>
  170.                     {% for category in categories %}
  171.                 
  172.                     <li class="{{category.class}}">
  173.                         <a href="{{ url('cm_blog_pro_page_list', {categories: [category.getId()]}) }}" class="list_category_link">
  174.                             {{ category.getName|raw }}
  175.                         </a>
  176.                     </li>
  177.                     {% endfor %}
  178.                 </ol>
  179.             </div>
  180.     
  181.             {% if pagination.totalItemCount > 0 %}
  182.                 <div class="ec-shelfRole" style="padding-top: 20px">
  183.                     <ul class="ec-shelfGrid list_blog">
  184.                         {% for blog in pagination %}
  185.                         <li class="ec-shelfGrid__item">
  186.                             <a href="{{ url('cm_blog_pro_page_detail', {'id': blog.slug ? blog.slug : blog.id}) }}">
  187.                                 <figure class="figure__main_image">
  188.                                     {% if blog.getMainListImage %}
  189.                                         <img src="{{ asset(blog.getMainListImage|no_image_product, 'save_image') }}" class='item_blog_image'></img>
  190.                                     {% else %}
  191.                                         <img src="{{ asset(''|no_image_product, 'save_image') }}" class='item_blog_image'></img>
  192.                                     {% endif %}
  193.                                     {% if blog.getFigCaption %}
  194.                                         <figcaption>{{ blog.getFigCaption }}</figcaption>
  195.                                     {% endif %}
  196.                                 </figure>
  197.                             </a>
  198.                             <h3 class="blog_title_h3">{{ blog.getTitle|length > 25 ? blog.getTitle|striptags|replace({('&nbsp;'):' '})|slice(0, 25)|raw ~ '...' : blog.getTitle|raw }}</h3> 
  199.                             <div class="blog_release_dc">
  200.                                 <div class="blog_release_date">{{ blog.release_date|date('Y.m.d')}}</div>
  201.                                 <ul class="blog_category">
  202.                                     {% for category in blog.getBlogCategories %}
  203.                                         <li class="{{category.getCategory.class}}">
  204.                                             <a href="{{ url('cm_blog_pro_page_list', {categories: [category.getCategory().getId()]}) }}" class="list_category_link">
  205.                                             {{ category.getCategory.getName|length > 15 ? category.getCategory.getName|striptags|replace({('&nbsp;'):' '})|slice(0, 15)|raw ~ '...' : category.getCategory.getName|raw }}
  206.                                             </a>
  207.                                         </li>
  208.                                     {% endfor %}        
  209.                                 </ul>
  210.                             </div> 
  211.                         </li>
  212.                         {% endfor %}
  213.                     </ul>
  214.                 </div>
  215.                 <div class="ec-pagerRole ec-product__group">
  216.                     <div class="pagenation">
  217.                         {% include "pager.twig" with {'pages': pagination.paginationData, 'routes' : 'cm_blog_pro_page_list'} %}                             
  218.                     </div>
  219.                 </div>
  220.             {% endif %}
  221.         </div>
  222.         <div class="side-bar">
  223.             <div class="mt-65 month-archive">
  224.                 <h5 class="tag-header">{{ 'plg.CMBlogPro.blog.month_archive'|trans }}</h5>
  225.                 <div class="archive-link-div">
  226.                     {% for key_y, val_y in monthArr %}
  227.                         <div class="archive-link-div__year {% if search_year == key_y %} active {% endif %}">
  228.                             <div class="archive-link-div__year__ttl">{{ key_y }}年</div>
  229.                             <div class="archive-link-div__year__ctt month-archive">
  230.                                 {% for key_m, val_m in val_y %}
  231.                                     <a href="{{ url('cm_blog_pro_page_list', {date: key_m}) }}">
  232.                                         <span>▶</span>
  233.                                         {{ val_m.ym }}({{ val_m.count }})
  234.                                     </a>
  235.                                 {% endfor %}
  236.                             </div>
  237.                         </div>
  238.                     {% endfor %}
  239.                 </div>
  240.             </div>
  241.         </div>
  242.     </div> 
  243. {% endblock %}