<div class="articles-filter">
   {include 'articles/block.articles.sections.tpl'}

   {include 'articles/block.articles.sort.tpl'}

   <div class="articles-search">
      <p>{t}Vyhledat článek{/t}</p>
      <div class="articles-search-inner">
         <input class="form-control" type="text" data-search-articles-input>
         <span class="fc icons_search"></span>
         {include "articles/block.articles.autocomplete.tpl"}
      </div>
   </div>

   <script>
      wpj.onReady.push(function () {
         var $filterForm = $('[data-filter="wrapper"]');
         var $filter = $filterForm.categoryFilter().data('wpjCategoryFilter');
         $filter.addItems({
            '{t}razeni{/t}': {
               type: jQuery.fn.categoryFilter.ItemSortingLinks,
            },
            '{t}strana{/t}': {
               type: jQuery.fn.categoryFilter.ItemPaging,
               onPageLoad: function (e, isNext) {
                  if (!wpj.domUtils.isInView($filterForm) && !isNext) {
                     wpj.domUtils.scrollTo($filterForm);
                  }

                  return this._super(arguments)
               },
               visible: false,
               value: {$body.pager.number}
            },
         });

         $filter.initialize();
      });
   </script>
</div>
