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

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

   <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>
