app/Plugin/TabaCMS2/Resource/template/default/list.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({page_count:10}) %}
  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. {% set breadcrumbs = [{'name': 'ニュース'}] %}
  16. {% block main %}
  17.     <section class="px-6 pb-10 pt-[7.5rem] md:pt-20 md:pb-1 text-black">
  18.         <div class="mx-auto w-full max-w-[63rem]">
  19.             <h1 class="flex items-start gap-4 md:gap-2">
  20.                 <span class="block h-[7.5rem] w-0.5 bg-gradient-to-b from-[#ADAAA6] md:h-16 md:w-px"></span>
  21.                 <p class="text-[2rem] font-light leading-normal tracking-widest md:text-xl">
  22.                     ニュース</p>
  23.             </h1>
  24.         </div>
  25.     </section>
  26.     {{ include('Block/breadcrumb.twig') }}
  27.     <section class="px-6 pb-[7.5rem] md:pb-20 text-black tracking-wider">
  28.         <div class="mx-auto w-full max-w-[50rem]">
  29.             <div class="grid border-t border-sub-gray">
  30.                 {% for post in post_list %}
  31.                     <a href="{{ post.getURI }}" class="grid gap-6 py-10 md:gap-4 border-b border-sub-gray hover">
  32.                         <h2 class="line-clamp-2 text-xl md:text-base font-medium leading-[1.8] text-black ">
  33.                             <span class="sr-only">タイトル:</span>
  34.                             {{ post.getTitle }}</h2>
  35.                         <time datetime={{ post.getPublicDate|date('Y-m-d') }} class="text-right text-sm text-black">
  36.                             <span class="sr-only">投稿日:</span>
  37.                             {{ post.getPublicDate|date('Y.m.d') }}</time>
  38.                     </a>
  39.                 {% endfor %}
  40.             </div>
  41.             {% if post_list.totalItemCount > 0 %}
  42.                 {% include "pager.twig" with {'pages':post_list.paginationData} %}
  43.             {% endif %}
  44.         </div>
  45.     </section>
  46. {% endblock %}