<script id="articleSearch" type="text/x-dot-template">
   {$redirectUrl = {path('kupshop_content_redirect_redirect_1')}}
   <div>
      {literal}
      {{? it.items.Clanky }}

      <div>
         {{? it.items.Clanky }}
         <div class="autocomplete-articles">
            <ul>
               {{~it.items.Clanky.items :item :index}}
               <li data-autocomplete-item="section">
                  <a href="{/literal}{$redirectUrl}{literal}?type=article&id={{=item.id}}">{{=item.label}}</a>
               </li>
               {{~}}
            </ul>
         </div>
         {{?}}
      </div>

   {{??}}
      <div class="autocomplete-noresult">
         <p>
            {/literal}
            {t}Žádný výsledek{/t}
            {literal}
         </p>
      </div>
      {{?}}
      {/literal}
   </div>
</script>

<script>
   wpj.onReady.push(function() {
      $('[data-search-articles-input]').productSearch({
         template: '#articleSearch'
      });
   });
</script>
