app/template/meldiastore/Block/news.twig line 1

Open in your IDE?
  1. {#
  2. This file is part of EC-CUBE
  3. Copyright(c) LOCKON CO.,LTD. All Rights Reserved.
  4. http://www.lockon.co.jp/
  5. For the full copyright and license information, please view the LICENSE
  6. file that was distributed with this source code.
  7. #}
  8. {% set NewsList = repository('Eccube\\Entity\\News').getList() %}
  9. <style>
  10.     .b-news {
  11.     margin: 50px auto 50px;
  12. }
  13. </style>
  14. <div class="b-news">
  15.     <div class="b-news__body">
  16.         <h2 class="b-news__title c-animation-fade js-animation-fade">
  17.             <span class="b-news__title--main">{{ 'News'|trans }}</span>
  18.             <span class="b-news__title--sub">{{ 'Information & Updates'|trans }}</span>
  19.         </h2>
  20.         <div class="b-news__contents c-animation-fade js-animation-fade" id="js-news__contents">
  21.             {% for News in NewsList %}
  22.                 <section class="b-news__post js-news__post">
  23.                     <header class="b-news__post-heading{% if News.description or News.url %} js-news__post-heading{% endif %}{% if News.description or News.url %} has-link{% endif %}">
  24.                         <div class="b-news__post-heading-contents">
  25.                             <p class="b-news__post-date">{{ News.publish_date|date_day }}</p>
  26.                             <h3 class="b-news__post-title">{{ News.title }}</h3>
  27.                         </div>
  28.                         {% if News.description or News.url %}
  29.                             <div class="b-news__post-actions">
  30.                                 <i class="b-news__post-actions-icon c-animation--rotate-forward material-icons">expand_more</i>
  31.                             </div>
  32.                         {% endif %}
  33.                     </header>
  34.                     <div class="b-news__post-contents js-news__post-contents">
  35.                         {{ News.description|raw|nl2br }}{% if News.url %}<a href="{{ News.url }}" {% if News.link_method == '1' %}target="_blank"{% endif %}>{{ '詳しくはこちら'|trans }}</a>{% endif %}
  36.                     </div>
  37.                 </section>
  38.             {% endfor %}
  39.             {% if NewsList|length > 5 %}
  40.                 <div class="b-news__actions" id="js-news__actions">
  41.                     <div class="b-news__actions-item">
  42.                         <button class="c-button mdc-button" id="js-news-button" data-mdc-auto-init="MDCRipple">
  43.                             <span class="c-button__label mdc-button__label">もっと見る</span>
  44.                         </button>
  45.                     </div>
  46.                 </div>
  47.             {% endif %}
  48.         </div>
  49.     </div>
  50. </div>
  51. {# scriptはindex.twigに記載 #}