app/Plugin/TabaCMS2/Resource/template/default/list_blog.twig line 1

Open in your IDE?
  1. {#
  2. Copyright (C) SPREAD WORKS Inc. All Rights Reserved.
  3. For the full copyright and license information, please view the LICENSE
  4. file that was distributed with this source code.
  5. #}
  6. {% extends 'default_frame.twig' %}
  7. {# 投稿リストの取得 #}
  8. {% set post_list = TabaCMSPostList() %}
  9. {% block javascript %}
  10. {{ TabaCMSAsset('script.js','script')|raw }}
  11. {% endblock javascript %}
  12. {% block stylesheet %}
  13. {{ TabaCMSAsset('style.css','style')|raw }}
  14. {% endblock stylesheet %}
  15. {% block main %}
  16. <div class="container-lg">
  17.     <div class="row">
  18.         <div class="col-12">
  19.             <div class="ec-pageHeader"><h1>{{ type.getTypeName }}</h1></div>
  20.         </div>
  21.     </div>
  22.     <div class="row">
  23.         <div class="col-md-9">
  24.             <ul class="row tabacms_blog_list tabacms_height_match">
  25.                 {% set no_image = TabaCMSAsset('no_image.jpg') %}
  26.                 {% for post in post_list %}
  27.                 <li class="col-sm-6 col-md-4">
  28.                     <article>
  29.                         <div class="tabacms_thumbnail_wrapper">
  30.                             <div class="tabacms_thumbnail">
  31.                                 {% set thumb = no_image %}
  32.                                 {% if post.getThumbnail is not empty %}
  33.                                 {% set thumb = asset(post.getThumbnail,'save_image') %}
  34.                                 {% endif %}
  35.                                 {% if post.getContentDiv == constant('CONTENT_DIV_BODY',post) %}
  36.                                 <a href="{{ post.getURI }}"><img src="{{ thumb }}"></a>
  37.                                 {% elseif post.getContentDiv == constant('CONTENT_DIV_LINK',post) %}
  38.                                 <a href="{{ post.getLinkUrl }}" {% if post.getLinkTarget %} target="{{ post.getLinkTarget }}" {% endif %}><img src="{{ thumb }}"></a>
  39.                                 {% elseif post.getContentDiv == constant('CONTENT_DIV_TITLE',post) %}
  40.                                 <img src="{{ thumb }}">
  41.                                 {% endif %}
  42.                             </div>
  43.                         </div>
  44.                         <div class="tabacms_detail">
  45.                             {% if post.getCategory is not empty %}
  46.                             <label class="text-nowrap tabacms_category_{{ post.getType.getDataKey }}_{{ post.getCategory.getDataKey }}" {{ post.getCategory.getTagAttributes|raw }}>{{ post.getCategory.getCategoryName }}</label>
  47.                             {% endif %}
  48.                             <time>
  49.                                 {{ post.getPublicDate|date('Y/m/d') }}
  50.                             </time>
  51.                             {% if post.getContentDiv == constant('CONTENT_DIV_BODY',post) %}
  52.                             <h2 class="tabacms_ellipsis_2">
  53.                                 <a href="{{ post.getURI }}">{{ post.getTitle }}</a>
  54.                             </h2>
  55.                             <p class="tabacms_ellipsis_3">
  56.                                 {{ post.getBody|striptags|raw }}
  57.                             </p>
  58.                             <a href="{{ post.getURI }}" class="tabacms_readmore">もっと読む</a>
  59.                             {% elseif post.getContentDiv == constant('CONTENT_DIV_LINK',post) %}
  60.                             <h2 class="tabacms_ellipsis_2">
  61.                                 <a href="{{ post.getLinkUrl }}" {% if post.getLinkTarget %} target="{{ post.getLinkTarget }}" {% endif %}>{{ post.getTitle }}</a>
  62.                             </h2>
  63.                             {% elseif post.getContentDiv == constant('CONTENT_DIV_TITLE',post) %}
  64.                             <h2 class="tabacms_ellipsis_2">
  65.                                 {{ post.getTitle }}
  66.                             </h2>
  67.                             {% endif %}
  68.                         </div>
  69.                     </article>
  70.                 </li>
  71.                 {% endfor %}
  72.             </ul>
  73.             {% if post_list.totalItemCount > 0 %}
  74.                 {% include "pager.twig" with {'pages':post_list.paginationData} %}
  75.             {% endif %}
  76.         </div>
  77.         <div class="col-md-3">
  78.             {{ TabaCMSWidget('search')|raw }}
  79.             {{ TabaCMSWidget('category')|raw }}
  80.             {{ TabaCMSWidget('tag')|raw }}
  81.         </div>
  82.     </div>
  83. </div>
  84. {% endblock %}