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

Open in your IDE?
  1. {% extends 'default_frame.twig' %}
  2. {% block javascript %}{% endblock %}
  3. {% block stylesheet %}
  4. <style>
  5. /*
  6. .pluginCMBblog .item_blog_image {
  7.     width: 100%;
  8.     height: 248px;
  9.     object-fit: cover;
  10. }
  11. */
  12. .pluginCMBblog .item_blog_image {
  13.     width: 100%;
  14.     height: 190px;
  15.     object-fit: cover;
  16. }
  17. .pluginCMBblog .figure__main_image {
  18.     margin: 0;
  19.     padding: 0;
  20.     display: grid;
  21.     justify-content: stretch;
  22.     align-items: flex-end;
  23. }
  24. .pluginCMBblog .item_blog_image,
  25. .pluginCMBblog figcaption {
  26.     padding: 0;
  27.     grid-column: 1/2;
  28.     grid-row: 1/2;
  29. }
  30. .pluginCMBblog figcaption {
  31.     text-align: center;
  32.     padding: 0.4rem 2rem;
  33.     font-size: 1rem;
  34.     background-color: rgba(0,0,0,.7);
  35.     color: #fff;
  36.     overflow: hidden;
  37.     white-space: normal;
  38.     word-wrap: break-word;
  39. }
  40. .pluginCMBblog .ec-topicpath .ec-topicpath__item {
  41.     display: initial;
  42. }
  43. .pluginCMBblog .list_blog_cat li {
  44.     display: initial;
  45.     letter-spacing: 0.2rem;
  46.     font-size: 16px;
  47.     padding: 0 15px;
  48. }
  49. .pluginCMBblog .list_blog_cat li:nth-child(n+2) {
  50.     border-left: 2px solid #ccc;
  51. }
  52. .pluginCMBblog .list_blog .list_category_link {
  53.     color: #337ab7;
  54.     padding: .2rem 0.5rem;
  55.     font-size: 80%;
  56.     border-right: 1px solid #ddd;
  57. }
  58. .pluginCMBblog .blog_category {
  59.     margin: 0;
  60.     padding: 0;
  61.     display: flex;
  62.     flex-wrap: wrap;
  63. }
  64. .pluginCMBblog .blog_category li {
  65.     display: initial;
  66. }
  67. .pluginCMBblog .blog_category li:last-child .list_category_link {
  68.     border: none;
  69. }
  70. .pluginCMBblog .blog_title_h3 {
  71.     font-size: 16px;
  72.     line-height: 1.4;  
  73.     margin-top: 10px;
  74.     margin-bottom: 1px;
  75.     word-break: break-word;
  76. }
  77. .pluginCMBblog .blog_release_date {
  78.     font-size: 1rem;
  79.     margin-bottom: 1rem;
  80. }
  81. .w-100 {
  82.     width: 100%
  83. }
  84. .side-bar > div {
  85.     width: 90%;
  86.     margin: 40px auto;
  87. }
  88. h5.tag-header {
  89.   padding: 1rem 2rem;
  90.   border-left: 4px solid #000;
  91. }
  92. .month-archive a {
  93.     text-decoration: underline;
  94.     display: block;
  95.     padding: 3px 27px;
  96. }
  97. .archive-link-div {
  98.     max-height: 600px;
  99.     overflow-y: scroll;
  100. }
  101. .archive-link-div::-webkit-scrollbar {
  102.     display: none;
  103. }
  104. @media screen and (max-width: 768px){
  105.     .pluginCMBblog .item_blog_image {
  106.         width: 100%;
  107.         height: 40vw;
  108.         object-fit: cover;
  109.     }
  110.     .side-bar > div {
  111.         width: 100%
  112.     }
  113. }
  114. @media only screen and (min-width: 768px) {
  115.     .side-bar {
  116.         width: 280px;
  117.         background-color: #f6f6f6;
  118.     }
  119. /*▼RZ 2023.09.11 EDIT ec-roleのスタイルをこのページに限定 ▼*/
  120. /*
  121.     .ec-role {
  122.         display: flex;
  123.         justify-content: flex-start
  124.     }
  125. */
  126.     .blog_box {
  127.         display: flex;
  128.         justify-content: flex-start
  129.     }
  130. /*▲RZ 2023.09.11 EDIT ec-roleのスタイルをこのページに限定 ▲*/
  131.     .mt-65 {
  132.         margin-top: 65px;
  133.     }
  134. }
  135. </style>
  136. {% endblock %}
  137. {% block main %}
  138.     <div class="ec-role pluginCMBblog">
  139.         <div class="blog_box">
  140.             <div class="w-100">
  141.                 <div class="ec-searchnavRole__topicpath">
  142.                     <ol class="ec-topicpath list_blog_cat">
  143.                         <li class="ec-topicpath__item">
  144.                             <a href="{{ url('cm_blog_pro_page_list') }}">{{ '全て'|trans }}</a>
  145.                         </li>
  146.                         {% for category in categories %}
  147.                     
  148.                         <li class="{{category.class}}">
  149.                             <a href="{{ url('cm_blog_pro_page_list', {categories: [category.getId()]}) }}" class="list_category_link">
  150.                                 {{ category.getName|raw }}
  151.                             </a>
  152.                         </li>
  153.                         {% endfor %}
  154.                     </ol>
  155.                 </div>
  156.         
  157.                 {% if pagination.totalItemCount > 0 %}
  158.                     <div class="ec-shelfRole" style="padding-top: 20px">
  159.                         <ul class="ec-shelfGrid list_blog">
  160.                             {% for blog in pagination %}
  161.                             <li class="ec-shelfGrid__item">
  162.                                 <a href="{{ url('cm_blog_pro_page_detail', {'id': blog.slug ? blog.slug : blog.id}) }}">
  163.                                     <figure class="figure__main_image">
  164.                                         {% if blog.getMainListImage %}
  165.                                             <img src="{{ asset(blog.getMainListImage|no_image_product, 'save_image') }}" class='item_blog_image' />
  166.                                         {% else %}
  167.                                             <img src="{{ asset(''|no_image_product, 'save_image') }}" class='item_blog_image' />
  168.                                         {% endif %}
  169.                                         {% if blog.getFigCaption %}
  170.                                             <figcaption>{{ blog.getFigCaption }}</figcaption>
  171.                                         {% endif %}
  172.                                     </figure>
  173.                                 </a>
  174.                                 <h3 class="blog_title_h3">{{ blog.getTitle|length > 45 ? blog.getTitle|striptags|replace({('&nbsp;'):' '})|slice(0, 45)|raw ~ '...' : blog.getTitle|raw }}</h3>  
  175.                                 <div class="blog_release_date">公開日:{{ blog.release_date|date('Y年m月d日')}}</div>
  176.                                 <ul class="blog_category">
  177.                                         {% for category in blog.getBlogCategories %}
  178.                                             <li class="{{category.getCategory.class}}">
  179.                                                 <a href="{{ url('cm_blog_pro_page_list', {categories: [category.getCategory().getId()]}) }}" class="list_category_link">
  180.                                                 {{ category.getCategory.getName|length > 15 ? category.getCategory.getName|striptags|replace({('&nbsp;'):' '})|slice(0, 15)|raw ~ '...' : category.getCategory.getName|raw }}
  181.                                                 </a>
  182.                                             </li>
  183.                                         {% endfor %}        
  184.                                 </ul>
  185.                             </li>
  186.                             {% endfor %}
  187.                         </ul>
  188.                     </div>
  189.                     <div class="ec-pagerRole">
  190.                         {% include "pager.twig" with {'pages': pagination.paginationData, 'routes' : 'cm_blog_pro_page_list'} %}
  191.                     </div>
  192.                 {% endif %}
  193.             </div>
  194.             <div class="side-bar">
  195.                 <div class="mt-65 month-archive">
  196.                     <h5 class="tag-header">{{ 'plg.CMBlogPro.blog.month_archive'|trans }}</h5>
  197.                     <div class="archive-link-div">
  198.                         {% for key, month in monthArr %}
  199.                             <a href="{{ url('cm_blog_pro_page_list', {date: key}) }}">{{ month }}</a>
  200.                         {% endfor %}
  201.                     </div>
  202.                 </div>
  203.             </div>
  204.         </div>
  205.     </div>
  206. {% endblock %}