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

Open in your IDE?
  1. {#
  2. This file is part of EC-CUBE
  3. Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  4. http://www.ec-cube.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. {% block javascript %}
  10. <script>
  11.     $(function() {
  12.         $('.news-list').each(function() {
  13.             var listLength = $(this).find('.news-item').length;
  14.             if (listLength > 5) {
  15.                 $(this).find('.news-item:gt(4)').each(function() {
  16.                     $(this).hide();
  17.                 });
  18.                 $(this).append('<a id="news_readmore" class="ec-inlineBtn--top">{{ '
  19.                     more '|trans }}</a>');
  20.                 var dispNum = 5;
  21.                 $(this).find('#news_readmore').click(function() {
  22.                     dispNum += 5;
  23.                     $(this).parent().find('.news-item:lt(' + dispNum + ')').show();
  24.                     if (dispNum >= listLength) {
  25.                         $(this).hide();
  26.                     }
  27.                 })
  28.             }
  29.         });
  30.         $('.news-head').on('click', function() {
  31.             $newsItem = $(this).parent('.news-item');
  32.             $newsDescription = $newsItem.children('.news-body');
  33.             if ($newsDescription.css('display') == 'none') {
  34.                 $newsItem.addClass('is_active');
  35.                 $newsDescription.slideDown(300);
  36.             } else {
  37.                 $newsItem.removeClass('is_active');
  38.                 $newsDescription.slideUp(300);
  39.             }
  40.             return false;
  41.         });
  42.     });
  43. </script>
  44. {% endblock %}
  45. <section class="p-section bg-gray notice">
  46.     <div class="inner">
  47.         <!-- <div class="notice-wrapper">
  48.             <h2 class="news-notice-heading">サイトリニューアルに伴う<span>重要なお知らせ</span></h2>
  49.             <p class="news-notice-text">
  50.                 平素より当社の商品をご愛顧いただき<br class="sp">ありがとうございます。<br>
  51.                 2025年4月○日(○)より当社ECサイトが<br class="sp">リニューアルオープンとなりました。<br>
  52.                 旧サイト(http://hirota-s.shop-pro.jp/)は<br class="sp">ご利用いただけなくなりましたので<br class="sp">以後こちらのサイトよりお買い求めください。<br>
  53.                 つきましては旧サイトで<br class="sp">会員登録されていたお客様へお願いです。<br>
  54.                 サイトリニューアルに伴い、会員情報は移行<br class="sp">されましたが、セキュリティの観点より<br><span class="bold">会員ログインパスワードがリセット</span><br class="sp">されております。<br>
  55.                 <span class="bold">画面右上の「ログイン」ボタンより<br class="sp">パスワードの再発行</span>を行なってください。<br>
  56.                 旧サイトで<span class="bold">保持されていた<br class="sp">ポイントはそのままご利用いただけます。</span>
  57.             </p>
  58.             <a href="{{ asset('assets/pdf/password_reissue.pdf', 'user_data') }}" target="_blank" class="news-notice-link">詳しい手順はこちら</a>
  59.         </div> -->
  60.         <div class="notice-wrapper">
  61.             <h2 class="news-notice-heading">商品価格改定のお知らせ</span></h2>
  62.             <p class="news-notice-text">
  63.                 2026年5月1日より、弊社商品の一部の価格を改定させていただきます。<br>
  64.                 弊社におきましては、お客様のご期待に沿うべく、経営の合理化を進め、コスト削減に努めて参りましたが、<br>
  65.                 近年の原材料、原油、物流コストなどの高騰により、私どもの企業努力のみでは、<br>
  66.                 現在の価格体系を維持するのが困難な状況となりました。<br>
  67.                 つきましては、誠に不本意ではございますが、以下の価格を改定させていただくことをお知らせいたします。<br>
  68.                 今後も品質の維持・向上を行いながら、皆様のご愛顧にお応えするため、今後も安定供給に努めて参ります。<br>
  69.                 何卒ご理解を賜りますようお願い申し上げます。
  70.             </p>
  71.             <dl class="news-notice-list">
  72.                 <div>
  73.                     <dt>改定時期</dt>
  74.                     <dd>2026年5月1日</dd>
  75.                 </div>
  76.                 <div>
  77.                     <dt>対象商品</dt>
  78.                     <dd>ぽんず・他一部商品</dd>
  79.                 </div>
  80.                 <div>
  81.                     <dt>改定内容</dt>
  82.                     <dd>希望小売価格で約8%〜16.7%、決済手数料・送料の一部</dd>
  83.                 </div>
  84.             </dl>
  85.             <p class="news-notice-name">2026年3月吉日<br>手造りひろた食品株式会社</p>
  86.         </div>
  87.     </div>
  88. </section>
  89. <section class="p-section bg-gray news">
  90.     <div class="inner">
  91.         <h2 class="p-title icon-top">
  92.             <span class="ec-secHeading__en">{{ 'お知らせ'|trans }}</span>
  93.         </h2>
  94.         <ul class="news-list">
  95.             {% for News in NewsList %}
  96.             <li class="news-item">
  97.                 <div class="news-head">
  98.                     <p class="news-date">
  99.                         {{ News.publish_date|date_day }}
  100.                     </p>
  101.                     <h3 class="news-title">
  102.                         {{ News.title }}
  103.                     </h3>
  104.                     {% if News.description or News.url %}
  105.                     <div class="news-close">
  106.                         <a class="news-close-button"></a>
  107.                     </div>
  108.                     {% endif %}
  109.                 </div>
  110.                 <div class="news-body">
  111.                     {{ News.description|raw|nl2br }}
  112.                     {% if News.url %}
  113.                     <br>
  114.                     <a href="{{ News.url }}" {% if News.link_method == '1' %}target="_blank" {% endif %}>{{ '詳しくはこちら'|trans }}</a>
  115.                     {% endif %}
  116.                 </div>
  117.             </li>
  118.             {% endfor %}
  119.         </ul>
  120.     </div>
  121. </section>