app/PluginData/TabaCMS/template/default/widget_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. {{ TabaCMSAsset('script.js','script')|raw }}
  7. {{ TabaCMSAsset('style.css','style')|raw }}
  8. {% if is_granted('ROLE_USER') %}
  9.     {% set customerRepository = repository('Eccube\\Entity\\Customer') %}
  10.     {% set customer = customerRepository.find(app.user.id) %}
  11.  
  12.     {% set shop_name = [] %}
  13.     {% set flag = false %}
  14.     {% set index = customer.getCustomData(12) %}
  15.     {% if index|length > 0  %}
  16.     
  17.     {% for i in 1..index|length %}
  18.         {% if index[i-1] == 10 %}
  19.             {% set shop_name =  shop_name|merge(['大田店']) %}
  20.         {% elseif index[i-1] == 11 %}
  21.             {% set shop_name =  shop_name|merge(['世田谷店']) %}
  22.         {% elseif index[i-1] == 12 %}
  23.             {% set shop_name =  shop_name|merge(['横浜店']) %}
  24.         {% elseif index[i-1] == 13 %}
  25.             {% set shop_name =  shop_name|merge(['大阪店']) %}
  26.         {% elseif index[i-1] == 14 %}
  27.             {% set shop_name =  shop_name|merge(['名古屋店']) %}
  28.         {% endif %}
  29.     {% endfor %}
  30.     {% endif %}
  31.     {% if options.type_data_key == 'fair-information' %}
  32.         {% set post_list = TabaCMSPostList({type_data_key:options.type_data_key,overwrite_query:false}) %}
  33.         {% if post_list is not empty %}
  34.             <div class="sec" id="march">
  35.                 <div class="march_in">
  36.                     <div class="march_header" data-aos="fade-up">
  37.                         <h2 class="march_main_ttl main_ttl">前日特別販売</h2>
  38.                         <!--<p class="march_main_ttl2 main_ttl">MARCH</p>-->
  39.                     </div>
  40.                     
  41.                     <div class="slide-wrapper">
  42.                         <div class="march_slide">
  43.                             {% set no_image = asset('assets/img/march-sample.png' , 'user_data')  %}
  44.                         
  45.                             {% for post in post_list %}
  46.                                 {% set thumb = no_image %}
  47.                                 {% if post.getThumbnail is not empty %}
  48.                                     {% set thumb = asset(post.getThumbnail,'save_image') %}
  49.                                 {% endif %}
  50.                                 <div class="march_items" data-aos="fade-up">
  51.                                     {% if post.getContentDiv == constant('CONTENT_DIV_BODY',post) %}
  52.                                         <a href="{{ post.getURI }}">
  53.                                             <div class="march_img"><img src="{{thumb}}"></div>       
  54.                                             <p class="march_date">{% if post.getCategory is not empty %}{{ post.getCategory.getCategoryName }}{%  endif %} {{ post.getPublicDate|date('Y.m.d') }}</p>
  55.                                             <h3 class="march_ttl">{{ post.getTitle }}</h3>
  56.                                             <p>{{ post.getMemo }}</p>
  57.                                         </a>
  58.                                     {% elseif post.getContentDiv == constant('CONTENT_DIV_LINK',post) %}
  59.                                         <a href="{{ post.getLinkUrl }}" {% if post.getLinkTarget %}target="{{ post.getLinkTarget }}"{% endif %}>
  60.                                             <div class="march_img"><img src="{{thumb}}"></div>       
  61.                                             <p class="march_date">{% if post.getCategory is not empty %}{{ post.getCategory.getCategoryName }}{%  endif %} {{ post.getPublicDate|date('Y.m.d') }}</p>
  62.                                             <h3 class="march_ttl">{{ post.getTitle }}</h3>
  63.                                             <p>{{ post.getMemo }}</p>
  64.                                         
  65.                                         </a>
  66.                                     {% elseif post.getContentDiv == constant('CONTENT_DIV_TITLE',post) %}
  67.                                         <a href="#">
  68.                                             <div class="march_img"><img src="{{thumb}}"></div>       
  69.                                             <p class="march_date">{% if post.getCategory is not empty %}{{ post.getCategory.getCategoryName }}{%  endif %} {{ post.getPublicDate|date('Y.m.d') }}</p>
  70.                                             <h3 class="march_ttl">{{ post.getTitle }}</h3>
  71.                                             <p>{{ post.getMemo }}</p>
  72.                                         </a>
  73.                                     {% endif %}
  74.                                 </div>
  75.                             {% endfor %}
  76.                         </div>
  77.                     </div>
  78.                     <div class="read_more text-right black_more">
  79.                         <a href="/fair-information" class="btn-mm-light magic-hover magic-hover__square">Read More</a>
  80.                     </div>
  81.                 </div>
  82.             </div>
  83.         
  84.         
  85.         {% endif %}
  86.     {% elseif  options.type_data_key == 'function' %}
  87.     
  88.        {% set PostRepository = repository('Plugin\\TabaCMS\\Entity\\Post') %}
  89.        {% set cat = customer.getCustomData(12) %}
  90.         
  91.         {% set post_list1 = TabaCMSPostList({type_data_key:options.type_data_key, overwrite_query:false ,page_count:3}) %}
  92.         {% if post_list1 is not empty %}
  93.         <div class="sec" id="jurnal">
  94.             <div class="fixedcontainer">
  95.     
  96.                 <div class="jurnal_header">
  97.                     <div class="jurnal_ttl" data-aos="fade-up">
  98.                         <h2 class="jurnal_main_ttl main_ttl">Function JOURNAL</h2>
  99.                     </div>
  100.                 </div>
  101.                 <div class="jurnal_list">
  102.                 {% for post in post_list1 %}
  103.                     {% if post.getThumbnail is empty  %}
  104.                         {% set thumb = asset('assets/img/jurnal-sample.png' , 'user_data') %}
  105.                     {% else %}
  106.                         {% set thumb = asset(post.getThumbnail,'save_image') %}
  107.                     {% endif  %}
  108.                     {% set thumb = asset(post.getThumbnail,'save_image') %}
  109.                     {% if post.getContentDiv == constant('CONTENT_DIV_BODY',post) %}
  110.                         <a href="{{ post.getURI }}" class="jurnal_three btn-mm-light magic-hover magic-hover__square" data-aos="fade-up">
  111.                             <div class="jurnal_img"><img src="{{thumb}}"></div>       
  112.                             <p class="jurnal_txt"><span>{{ post.title }}</span>{{post.memo}}</p>
  113.                         </a>
  114.                     {% elseif post.getContentDiv == constant('CONTENT_DIV_LINK',post) %}
  115.                         <a href="{{ post.getLinkUrl }}" {% if post.getLinkTarget %}target="{{ post.getLinkTarget }}"{% endif %} class="jurnal_three btn-mm-light magic-hover magic-hover__square" data-aos="fade-up"> 
  116.                             <div class="jurnal_img"><img src="{{thumb}}"></div>       
  117.                             <p class="jurnal_txt"><span>{{ post.title }}</span>{{post.memo}}</p>
  118.                         </a>
  119.                     {% elseif post.getContentDiv == constant('CONTENT_DIV_TITLE',post) %}
  120.                         <a href="#" class="jurnal_three btn-mm-light magic-hover magic-hover__square" data-aos="fade-up">
  121.                             <div class="jurnal_img"><img src="{{thumb}}"></div>       
  122.                             <p class="jurnal_txt"><span>{{ post.title }}</span>{{post.memo}}</p>
  123.                         </a>
  124.                     {% endif %}
  125.                 {% endfor %}
  126.             </div>
  127.             <div class="read_more text-right" data-aos="fade-up">
  128.                 <a href="{{ type.getListURI }}" class="btn-mm-light magic-hover magic-hover__square">Read More</a>
  129.             </div>
  130.             </div>
  131.         </div>
  132.         {% else %}
  133.         <div class="sec" id="jurnal">
  134.             <div class="fixedcontainer">
  135.             <div class="jurnal_header">
  136.                 <div class="jurnal_ttl" data-aos="fade-up">
  137.                     <h2 class="jurnal_main_ttl main_ttl">対応する投稿が存在しません。</h2>
  138.                 </div>
  139.             </div>
  140.         </div>
  141.         </div>
  142.         {% endif %}
  143.    
  144.     {% elseif  options.type_data_key == 'buyer-information' %}
  145.     
  146.         {% set post_list = TabaCMSPostList({type_data_key:options.type_data_key,overwrite_query:false}) %}
  147.       
  148.         {% if post_list is not empty %}
  149.             <div id="buyer" class="sec">
  150.                 <div class="fixedcontainer">
  151.                     <h2 class="buyer_main_ttl main_ttl" data-aos="fade-up">OUR BUYERS</h2>
  152.                     {# {% set post_list = TabaCMSPostList({type_data_key:options.type_data_key,category:cat , overwrite_query:false }) %} #}
  153.                     <ul class="buyer_list">
  154.                         {% set no_image = asset('assets/img/buyer-sample.png' , 'user_data')  %}
  155.                         {% for post in post_list %}
  156.                             {% set thumb = no_image %}
  157.                             {% if post.getThumbnail is not empty %}
  158.                                 {% set thumb = asset(post.getThumbnail,'save_image') %}
  159.                             {% endif %}
  160.                                 {% set break = false %}
  161.                                 {% if shop_name is not empty %}
  162.                                     {% for i in 1..shop_name|length if not break %}
  163.                                         {% if post.getCategory is not empty %}
  164.                                             {% if shop_name[i-1] == post.getCategory.getCategoryName %}
  165.                                                 {% set flag = true %}
  166.                                                 {% set break = true %}
  167.                                             {% else %}
  168.                                                 {% set flag = false %}
  169.                                             {% endif %}
  170.                                         {% else %}
  171.                                             {% set flag = false %}
  172.                                             {% set break = true %}
  173.                                         {% endif %}
  174.                                     
  175.                                     {% endfor %}
  176.                                     {% endif %}
  177.                                 {% if  flag == true %}
  178.                                 <li data-aos="fade-up">
  179.                                     <div class="buyer_one btn-mm-light magic-hover magic-hover__square">
  180.                                         <div class="buyer_img"><img src="{{thumb}}"></div>       
  181.                                         <p class="buyer_subttl">{%if post.category != null %}{{ post.category.categoryName }}{% endif %}</p>
  182.                                         <p class="buyer_ttl">{{ post.title }}</p>
  183.                                     </div>
  184.                                     </li>
  185.                                 {% endif %}
  186.                         {% endfor %}
  187.                     </ul>
  188.                 </div>
  189.             </div>
  190.         {% endif %}
  191.     {% elseif  options.type_data_key == 'buyer' %}
  192.         {% set post_list = TabaCMSPostList({type_data_key:'buyer-information',overwrite_query:false}) %}
  193.         {% if post_list is not empty %}
  194.         <div id="buyercomment" class="sec">
  195.             <div class="fixedcontainer">
  196.                 <h2 class="buyercomment_main_ttl main_ttl" data-aos="fade-up">BUYER’S COMMENT</h2>
  197.             
  198.                 {# {% set post_list = TabaCMSPostList({type_data_key:options.type_data_key,category:cat , overwrite_query:false }) %} #}
  199.                 <div class="buyercomment_list">
  200.                     {% set no_image = asset('assets/img/buyer-sample.png' , 'user_data')  %}
  201.                     {% for post in post_list %}
  202.                         {% set thumb = no_image %}
  203.                         {% if post.getThumbnail is not empty %}
  204.                             {% set thumb = asset(post.getThumbnail,'save_image') %}
  205.                         {% endif %}
  206.                             {% set break = false %}
  207.                             {% if shop_name is not empty %}
  208.                                 {% for i in 1..shop_name|length if not break %}
  209.                                     {% if post.getCategory is not empty %}
  210.                                         {% if shop_name[i-1] == post.getCategory.getCategoryName %}
  211.                                             {% set flag = true %}
  212.                                             {% set break = true %}
  213.                                         {% else %}
  214.                                             {% set flag = false %}
  215.                                         {% endif %}
  216.                                     {% else %}
  217.                                         {% set flag = false %}
  218.                                         {% set break = true %}
  219.                                     {% endif %}
  220.                                 
  221.                                 {% endfor %}
  222.                                 {% endif %}
  223.                             {% if  flag == true %}
  224.                             <div class="buyercomment_items" data-aos="fade-up">
  225.                                 <div class="image"><img src="{{thumb}}"></div>  
  226.                                 <div class="info" data-match-height="buyer">     
  227.                                     <p class="tit">{{ post.title }}</p>
  228.                                     <p > {{ post.getBody|raw }}</p>
  229.                                 </div>
  230.                             </div>
  231.                             {% endif %}
  232.                     {% endfor %}
  233.                 </div>
  234.             </div>
  235.         </div>
  236.         {% endif %}
  237.     {% endif %}
  238.     
  239. {% else %}
  240.     {% if options.type_data_key == 'fair-information' %}
  241.      <div class="sec" id="march">
  242.         <div class="march_in">
  243.             <div class="march_header" data-aos="fade-up">
  244.                 <h2 class="march_main_ttl main_ttl">前日特別販売</h2>
  245.                 <!--<p class="march_main_ttl2 main_ttl">MARCH</p>-->
  246.             </div>
  247.     
  248.             <div class="slide-wrapper">
  249.                     <div class="march_slide">
  250.                         {% set no_image = asset('assets/img/march-sample.png' , 'user_data')  %}
  251.                         {% set post_list = TabaCMSPostList({type_data_key:options.type_data_key,overwrite_query:false}) %}
  252.                     
  253.                         {% for post in post_list %}
  254.                             {% set thumb = no_image %}
  255.                             {% if post.getThumbnail is not empty %}
  256.                                 {% set thumb = asset(post.getThumbnail,'save_image') %}
  257.                             {% endif %}
  258.                             <div class="march_items" data-aos="fade-up">
  259.                                 
  260.                                     {% if post.getContentDiv == constant('CONTENT_DIV_BODY',post) %}
  261.                                         <a href="{{ post.getURI }}">
  262.                                             <div class="march_img"><img src="{{thumb}}"></div>       
  263.                                             <p class="march_date">{% if post.getCategory is not empty %}{{ post.getCategory.getCategoryName }}{%  endif %} {{ post.getPublicDate|date('Y.m.d') }}</p>
  264.                                             <h3 class="march_ttl">{{ post.getTitle }}</h3>
  265.                                             <p>{{ post.getMemo }}</p>
  266.                                         </a>
  267.                                     {% elseif post.getContentDiv == constant('CONTENT_DIV_LINK',post) %}
  268.                                         <a href="{{ post.getLinkUrl }}" {% if post.getLinkTarget %}target="{{ post.getLinkTarget }}"{% endif %}>
  269.                                             <div class="march_img"><img src="{{thumb}}"></div>       
  270.                                             <p class="march_date">{% if post.getCategory is not empty %}{{ post.getCategory.getCategoryName }}{%  endif %} {{ post.getPublicDate|date('Y.m.d') }}</p>
  271.                                             <h3 class="march_ttl">{{ post.getTitle }}</h3>
  272.                                             <p>{{ post.getMemo }}</p>
  273.                                         
  274.                                         </a>
  275.                                     {% elseif post.getContentDiv == constant('CONTENT_DIV_TITLE',post) %}
  276.                                         <a href="#">
  277.                                             <div class="march_img"><img src="{{thumb}}"></div>       
  278.                                             <p class="march_date">{% if post.getCategory is not empty %}{{ post.getCategory.getCategoryName }}{%  endif %} {{ post.getPublicDate|date('Y.m.d') }}</p>
  279.                                             <h3 class="march_ttl">{{ post.getTitle }}</h3>
  280.                                             <p>{{ post.getMemo }}</p>
  281.                                         </a>
  282.                                     {% endif %}
  283.                                 
  284.                             </div>
  285.                             {% endfor %}
  286.                     </div>
  287.             </div>
  288.             <div class="read_more text-right black_more">
  289.                 <a href="/fair-information" class="btn-mm-light magic-hover magic-hover__square">Read More</a>
  290.             </div>
  291.         </div>
  292.         </div>
  293.     
  294.     {% elseif  options.type_data_key == 'function' %}
  295.         <div class="sec" id="jurnal">
  296.             <div class="fixedcontainer">
  297.         
  298.                 <div class="jurnal_header">
  299.                     <div class="jurnal_ttl" data-aos="fade-up">
  300.                         <h2 class="jurnal_main_ttl main_ttl">Function JOURNAL</h2>
  301.                     </div>
  302.                 </div>
  303.                 <div class="jurnal_list">
  304.                     {% set post_list_1 = TabaCMSPostList({type_data_key:options.type_data_key,  overwrite_query:false ,page_count:3}) %}
  305.                     {% for post in post_list_1 %}
  306.                         {% if post.getThumbnail is empty  %}
  307.                             {% set thumb = asset('assets/img/jurnal-sample.png' , 'user_data') %}
  308.                         {% else %}
  309.                             {% set thumb = asset(post.getThumbnail,'save_image') %}
  310.                         {% endif  %}
  311.                         {% set thumb = asset(post.getThumbnail,'save_image') %}
  312.                         {% if post.getContentDiv == constant('CONTENT_DIV_BODY',post) %}
  313.                             <a href="{{ post.getURI }}" class="jurnal_three btn-mm-light magic-hover magic-hover__square" data-aos="fade-up">
  314.                                 <div class="jurnal_img"><img src="{{thumb}}"></div>       
  315.                                 <p class="jurnal_txt"><span>{{ post.title }}</span>{{post.memo}}</p>
  316.                             </a>
  317.                         {% elseif post.getContentDiv == constant('CONTENT_DIV_LINK',post) %}
  318.                             <a href="{{ post.getLinkUrl }}" {% if post.getLinkTarget %}target="{{ post.getLinkTarget }}"{% endif %} class="jurnal_three btn-mm-light magic-hover magic-hover__square" data-aos="fade-up"> 
  319.                                 <div class="jurnal_img"><img src="{{thumb}}"></div>       
  320.                                 <p class="jurnal_txt"><span>{{ post.title }}</span>{{post.memo}}</p>
  321.                             
  322.                             </a>
  323.                         {% elseif post.getContentDiv == constant('CONTENT_DIV_TITLE',post) %}
  324.                             <a href="#" class="jurnal_three btn-mm-light magic-hover magic-hover__square" data-aos="fade-up">
  325.                                 <div class="jurnal_img"><img src="{{thumb}}"></div>       
  326.                                 <p class="jurnal_txt"><span>{{ post.title }}</span>{{post.memo}}</p>
  327.                             </a>
  328.                         {% endif %}
  329.                     {% endfor %}
  330.                         
  331.                 </div>
  332.                 <div class="read_more text-right" data-aos="fade-up">
  333.                     <a href="{{ type.getListURI }}" class="btn-mm-light magic-hover magic-hover__square">Read More</a>
  334.                 </div>
  335.             </div>
  336.         </div>
  337.     {% elseif  options.type_data_key == 'buyer-information' %}
  338.         
  339.         {% set no_image = asset('assets/img/jurnal-sample.png' , 'user_data')  %}
  340.         {% set post_list = TabaCMSPostList({type_data_key:options.type_data_key,overwrite_query:false}) %}
  341.         <div id="buyer" class="sec">
  342.             <div class="fixedcontainer">
  343.                 <h2 class="buyer_main_ttl main_ttl" data-aos="fade-up">OUR BUYERS</h2>
  344.         
  345.                 <ul class="buyer_list">
  346.                     {% set no_image = asset('assets/img/buyer-sample.png' , 'user_data')  %}
  347.                     {% for post in post_list %}
  348.                         {% set thumb = no_image %}
  349.                         {% if post.getThumbnail is not empty %}
  350.                             {% set thumb = asset(post.getThumbnail,'save_image') %}
  351.                         {% endif %}
  352.                         <li data-aos="fade-up">
  353.                             <div class="buyer_one btn-mm-light magic-hover magic-hover__square">
  354.                                 <div class="buyer_img"><img src="{{ thumb }}"></div>       
  355.                                 <p class="buyer_subttl">{%if post.category != null %}{{ post.category.categoryName }}{% endif %}</p>
  356.                                 <p class="buyer_ttl">{{ post.title }}</p>
  357.                             </div>
  358.                         </li>
  359.                 
  360.                     {% endfor %}
  361.                 </ul>
  362.             </div>
  363.         </div>
  364.      {% elseif  options.type_data_key == 'buyer' %}
  365.         
  366.         {% set no_image = asset('assets/img/jurnal-sample.png' , 'user_data')  %}
  367.         {% set post_list = TabaCMSPostList({type_data_key:'buyer-information',overwrite_query:false}) %}
  368.         <div id="buyercomment" class="sec">
  369.             <div class="fixedcontainer">
  370.                 <h2 class="buyer_main_ttl main_ttl" data-aos="fade-up">OUR BUYERS</h2>
  371.         
  372.                 <div class="buyercomment_list">
  373.                     {% set no_image = asset('assets/img/buyer-sample.png' , 'user_data')  %}
  374.                     {% for post in post_list %}
  375.                         {% set thumb = no_image %}
  376.                         {% if post.getThumbnail is not empty %}
  377.                             {% set thumb = asset(post.getThumbnail,'save_image') %}
  378.                         {% endif %}
  379.                         <div class="buyercomment_items" data-aos="fade-up">
  380.                             <div class="image"><img src="{{ thumb }}"></div> 
  381.                             <div class="info">      
  382.                                 <p class="tit">{{ post.title }}</p>
  383.                                 <p>{%if post.category != null %}{{ post.category.categoryName }}{% endif %}</p>
  384.                             </div>
  385.                         </div>
  386.                     {% endfor %}
  387.                 </div>
  388.             </div>
  389.         </div>
  390.     {% endif %}
  391. {% endif %}    
  392. <script>
  393.     $(function() {
  394.         // 0個
  395.         if( $('div.march_img').length == '0' ){
  396.             $('div#march').hide();
  397.         }
  398.     });
  399. </script>