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. }
  13. .pluginCMBblog .ec-topicpath .ec-topicpath__item{
  14.     display: initial !important;
  15. }
  16. .pluginCMBblog .list_blog_cat li {
  17.     display: initial !important;
  18.     letter-spacing: 0.2rem;
  19.     border-right: 1px solid #ddd;
  20.     font-size: 16px;
  21. }
  22. .pluginCMBblog .list_category_link{
  23.     padding: 0 0.5rem;
  24. }
  25. .pluginCMBblog .list_blog .list_category_link{
  26.     color: #337ab7;
  27.     padding: 0 0.5rem;
  28. }
  29. .pluginCMBblog .blog_category li:last-child{
  30.     border: none;
  31. }
  32. .pluginCMBblog .blog_category{
  33.     margin: 0;
  34.     padding: 0;
  35. }
  36. .pluginCMBblog .blog_category li{
  37.     display: initial;
  38.     border-right: 1px solid #ddd;
  39. }
  40. .pluginCMBblog .list_blog_cat li:last-child {
  41.     border-right: none;
  42. }
  43. .pluginCMBblog .blog_title_h3{
  44.     font-size: 16px !important;
  45.     line-height: 1.4;
  46.     margin-top: 10px;
  47.     word-break: break-word;
  48. }
  49. .w-100 {
  50.     width: 100%
  51. }
  52. .side-bar > div {
  53.     width: 90%;
  54.     margin:40px auto;
  55. }
  56. h5.tag-header {
  57.   padding: 1rem 2rem;
  58.   border-left: 4px solid #000;
  59. }
  60. .month-archive a {
  61.     text-decoration: underline;
  62.     display: block;
  63.     padding: 3px 27px;
  64. }
  65. .archive-link-div {
  66.     max-height: 600px;
  67.     overflow-y: scroll;
  68. }
  69. .archive-link-div::-webkit-scrollbar {
  70.     display: none;
  71. }
  72. @media screen and (max-width: 768px){
  73. .pluginCMBblog .item_blog_image {
  74.     width: 100% !important;
  75.     height: 40vw;
  76.     object-fit: cover;
  77.     }
  78.     .side-bar > div {
  79.         width: 100%
  80.     }
  81. }
  82. @media only screen and (min-width: 768px) {
  83.     .side-bar {
  84.         width: 280px;
  85.         background-color: #f6f6f6;
  86.     }
  87.     .ec-role {
  88.         display: flex;
  89.         justify-content: flex-start
  90.     }
  91.     .mt-65 {
  92.         margin-top: 65px!important;
  93.     }
  94. }
  95. .blog-category-item {
  96.     color: #337ab7 !important;
  97. }
  98. .blog-category-item.is-selected {
  99.     color: rgb(82, 82, 99) !important;
  100. }
  101. .blog-category-item .list_category_link {
  102.     color: inherit;
  103. }
  104. </style>
  105. {% endblock %}
  106. {% block main %}
  107. {% set selectedCategoryIds = null %}
  108. {% if 'categories' in searchData|keys %}
  109.     {% set selectedCategoryIds = searchData.categories %}
  110. {% endif %}
  111.     <div class="ec-role pluginCMBblog content__inner">
  112.         <div class="w-100">
  113.             <div class="ec-searchnavRole__topicpath">
  114.                 <ol class="ec-topicpath list_blog_cat">
  115.                     {# 選択済みカテゴリを優先する #}
  116.                     {# {% if selectedCategoryIds is not null %}
  117.                         {% for category in categories %} #}
  118.                             {# 除外カテゴリに指定されている場合は表示しない #}
  119.                             {# {% if excludeCategoryIds is empty or category.getId() not in excludeCategoryIds %}
  120.                                 {% for selectedCategoryId in selectedCategoryIds %}
  121.                                     {% if selectedCategoryId == category.getId() %}
  122.                                     <li class="{{category.class}} blog-category-item is-selected">
  123.                                         <a href="{{ url('blog_list', {categories: [category.getId()]}) }}" class="list_category_link">
  124.                                             {{ category.getName|raw }}
  125.                                         </a>
  126.                                     </li>
  127.                                     {% endif %}
  128.                                 {% endfor %}
  129.                             {% endif %}
  130.                         {% endfor %}
  131.                     {% endif %} #}
  132.                     <li class="blog-category-item {{ selectedCategoryIds is not null ? ' ec-topicpath__item' : ' is-selected' }}" >
  133.                         <a href="{{ url('blog_list') }}" class="list_category_link">{{ '全て'|trans }}</a>
  134.                     </li>
  135.                     {% for category in categories %}
  136.                         {# 除外カテゴリに指定されている場合は表示しない #}
  137.                         {% if excludeCategoryIds is empty or category.getId() not in excludeCategoryIds %}
  138.                             {# 検索条件のカテゴリにデザイン用のclassを付与 #}
  139.                             {% if selectedCategoryIds is not null %}
  140.                                 {% for selectedCategoryId in selectedCategoryIds %}
  141.                                     {% if selectedCategoryId != category.getId() %}
  142.                                         <li class="{{category.class}} blog-category-item">
  143.                                             <a href="{{ url('blog_list', {categories: [category.getId()]}) }}" class="list_category_link">
  144.                                                 {{ category.getName|raw }}
  145.                                             </a>
  146.                                         </li>
  147.                                     {% else %}
  148.                                       <li class="{{category.class}} blog-category-item is-selected">
  149.                                           <a href="{{ url('blog_list', {categories: [category.getId()]}) }}" class="list_category_link">
  150.                                               {{ category.getName|raw }}
  151.                                           </a>
  152.                                       </li>
  153.                                     {% endif %}
  154.                                 {% endfor %}
  155.                             {% else %}
  156.                             <li class="{{category.class}} blog-category-item">
  157.                                 <a href="{{ url('blog_list', {categories: [category.getId()]}) }}" class="list_category_link">
  158.                                     {{ category.getName|raw }}
  159.                                 </a>
  160.                             </li>
  161.                             {% endif %}
  162.                         {% endif %}
  163.                     {% endfor %}
  164.                 </ol>
  165.             </div>
  166.             {% if pagination.totalItemCount > 0 %}
  167.                 <div class="ec-shelfRole" style="padding-top: 20px">
  168.                     <ul class="ec-shelfGrid list_blog">
  169.                         {% for blog in pagination %}
  170.                         <li class="ec-shelfGrid__item">
  171.                             <a href="{{ url('blog_detail/{id}', {'id': blog.slug ? blog.slug : blog.id}) }}">
  172.                                 <figure class="figure__main_image">
  173.                                 {% if blog.getMainListImage %}
  174.                                     <img src="{{ asset(blog.getMainListImage|no_image_product, 'save_image') }}" class='item_blog_image'></img>
  175.                                     {% else %}
  176.                                     <img src="{{ asset(''|no_image_product, 'save_image') }}" class='item_blog_image'></img>
  177.                                 {% endif %}
  178.                                 </figure>
  179.                             </a>
  180.                             <a href="{{ url('blog_detail/{id}', {'id': blog.slug ? blog.slug : blog.id}) }}">
  181.                               <h3 class="blog_title_h3">{{ blog.getTitle|length > 45 ? blog.getTitle|striptags|replace({('&nbsp;'):' '})|slice(0, 45)|raw ~ '...' : blog.getTitle|raw }}</h3>
  182.                             </a>
  183.                             <p class="blog_day">{{blog.release_date|date('Y年m月d日')}}</p>
  184.                             <ul class="blog_category">
  185.                                     {% for category in blog.getBlogCategories %}
  186.                                         <li class="{{category.getCategory.class}}">
  187.                                             <a href="{{ url('blog_list', {categories: [category.getCategory().getId()]}) }}" class="list_category_link">
  188.                                             {{ category.getCategory.getName|length > 15 ? category.getCategory.getName|striptags|replace({('&nbsp;'):' '})|slice(0, 15)|raw ~ '...' : category.getCategory.getName|raw }}
  189.                                             </a>
  190.                                         </li>
  191.                                     {% endfor %}
  192.                             </ul>
  193.                         </li>
  194.                         {% endfor %}
  195.                     </ul>
  196.                 </div>
  197.                 <div class="ec-pagerRole">
  198.                     {% include "pager.twig" with {'pages': pagination.paginationData, 'routes' : 'blog_list'} %}
  199.                 </div>
  200.             {% endif %}
  201.             <div class="page__inner mt-50">
  202.               <h2 class="mod_movie-h2">
  203.                 ブログ一覧
  204.               </h2>
  205.               <div class="mod_movie-btn-more">
  206.                 <a href="{{ url('blog_list') }}">ブログ一覧に戻る</a>
  207.               </div>
  208.             </div>
  209.         </div>
  210.         {#<div class="side-bar">#}
  211.         {#    <div class="mt-65 month-archive">#}
  212.         {#        <h5 class="tag-header">{{ 'plg.CMBlogPro.blog.month_archive'|trans }}</h5>#}
  213.         {#        <div class="archive-link-div">#}
  214.         {#            {% for key, month in monthArr %}#}
  215.         {#                <a href="{{ url('cm_blog_pro_page_list', {date: key}) }}">{{ month }}</a>#}
  216.         {#            {% endfor %}#}
  217.         {#        </div>#}
  218.         {#    </div>#}
  219.         {#</div>#}
  220.     </div>
  221. {% endblock %}