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

Open in your IDE?
  1. {#
  2.     This file is part of EC-CUBE
  3.     
  4.     Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  5.     
  6.     http://www.ec-cube.co.jp/
  7.     
  8.     For the full copyright and license information, please view the LICENSE
  9.     file that was distributed with this source code.
  10.     #}
  11.     {% set NewsList = repository('Eccube\\Entity\\News').getList() %}
  12.     
  13.     {% block javascript %}
  14.         <script>
  15.             $(function() {
  16.                 $('.ec-newsRole__news').each(function() {
  17.                     var listLength = $(this).find('.ec-newsRole__newsItem').length;
  18.                     if (listLength > 5) {
  19.                         $(this).find('.ec-newsRole__newsItem:gt(4)').each(function() {
  20.                             $(this).hide();
  21.                         });
  22.                         $(this).append('<a id="news_readmore" class="ec-inlineBtn--top">{{ 'more'|trans }}</a>');
  23.                         var dispNum = 5;
  24.                         $(this).find('#news_readmore').click(function() {
  25.                             dispNum += 5;
  26.                             $(this).parent().find('.ec-newsRole__newsItem:lt(' + dispNum + ')').show();
  27.                             if (dispNum >= listLength) {
  28.                                 $(this).hide();
  29.                             }
  30.                         })
  31.                     }
  32.                 });
  33.     
  34.                 $('.ec-newsRole__newsHeading').on('click', function() {
  35.                     $newsItem = $(this).parent('.ec-newsRole__newsItem');
  36.                     $newsDescription = $newsItem.children('.ec-newsRole__newsDescription');
  37.                     if ($newsDescription.css('display') == 'none') {
  38.                         $newsItem.addClass('is_active');
  39.                         $newsDescription.slideDown(300);
  40.                     } else {
  41.                         $newsItem.removeClass('is_active');
  42.                         $newsDescription.slideUp(300);
  43.                     }
  44.                     return false;
  45.                 });
  46.             });
  47.         </script>
  48.     {% endblock %}
  49.     
  50.     <section class="top_inner">
  51.         <section class="top_news">
  52.             <div class="wrap">
  53.                 <div class="top_box">
  54.                     <div class="common_ttl_box">
  55.                         <p class="en_ttl f_cent">News</p>
  56.                         <h2 class="ttl">ビオトープからのお知らせ</h2>
  57.                         <p class="ttl_comment">大阪難波・心斎橋・北新地の花屋biotop(ビオトープ)では<br>お客様がより快適にお花探しができるよう、<br class="sp">定期的に情報を配信しております。ぜひご確認ください。</p>
  58.                     </div>
  59.                 </div>
  60.                 
  61.                 <div class="news_list">
  62.                     <ul>
  63.                         {% for News in NewsList %}
  64.                         <li>
  65.                             <a {% if News.url %} href="{{ News.url }}" {% else %} href="{{ url('news_detail', {'id': News.id}) }}" {% endif %}>
  66.                                 <p class="ttl">{{ News.publish_date|date_day }}</p>
  67.                                 <p class="ttl">{{ News.title }}</p>
  68.                             </a>
  69.                         </li>
  70.                         {% endfor %}
  71.                     </ul>
  72.                 </div>
  73.                 <div style="text-align: center;"></div>
  74.             </div>
  75.             <div class="top_mother_ban_area">
  76.                 <div class="wrap">
  77.                     <!-- <a href="">
  78.                         <div style="text-align: center;">
  79.                             <img class="pc" src="/html/user_data/assets/img/common/banner_mothersday_yoko.png" alt="" width="100%">
  80.                             <img class="sp" src="/html/user_data/assets/img/common/banner_mothersday_yoko_sp.png" alt="" width="100%">
  81.                         </div>
  82.                     </a> -->
  83.                     <!-- <a href="">
  84.                         <div style="text-align: center;">
  85.                             <img class="pc" src="/html/user_data/assets/img/common/banner_fathersday_yoko.png" alt="" width="100%">
  86.                             <img class="sp" src="/html/user_data/assets/img/common/banner_fathersday_yoko_sp.png" alt="" width="100%">
  87.                         </div>
  88.                     </a> -->
  89.                     <a href="https://www.biotop.ne.jp/products/list?category_id=54">
  90.                         <div style="text-align: center;">
  91.                             <img class="pc" src="/html/user_data/assets/img/common/banner_new_arrival_pc.jpg" alt="" width="100%">
  92.                             <img class="sp" src="/html/user_data/assets/img/common/banner_new_arrival_sp.jpg" alt="" width="100%">
  93.                         </div>
  94.                     </a>
  95.                 </div>
  96.             </div>
  97.         </section>
  98.     </section>