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