description = "Main News Page" [staticPage] useContent = 0 default = 0 [blogPosts] pageNumber = "{{ :page }}" postsPerPage = 6 noPostsMessage = "No posts found" sortOrder = "published_at desc" categoryPage = 404 postPage = 404 [searchInput] useAutoComplete = 0 autoCompleteResultCount = 5 showProviderBadge = 0 searchPage = "search-result.htm" == addCss(CombineAssets::combine($css, base_path('themes/linus'))); //$this->addJs(CombineAssets::combine($scripts, base_path('themes/linus'))); $theme = Cms\Classes\Theme::getEditTheme(); $pageList = new RainLab\Pages\Classes\PageList($theme); $allPages = $pageList->listPages(); $this['heroIn'] = null; foreach ($allPages as $pg) { if($pg->id == 'news-banner') { $this['heroIn'] = $pg; } } $this->prepareVariable(); } function prepareVariable(){ $options = post('Filter', ['sort' => 'published_at desc']); $this['postList'] = Post::listFrontEnd($options); $this['sortingoptions'] = Post::$allowedSortingOptions; } function onSortPost(){ $this->prepareVariable(); } function onPage(){ $this->prepareVariable(); } ?> == {% partial 'site/head' %} {% partial 'site/header' %}
{% partial 'hero-banner' %}
{{ form_ajax('onSortPost', { id: 'sort-post-form', update: { 'post-load' : '#post-wrapper', 'post-page': '#post-page' } }) }}
{{ form_close() }}
{% partial 'post-load' %}
{% partial 'post-page' %}
{{ form_ajax('onPage', { id : 'page-form', update: { 'post-load': '#post-wrapper', 'post-page': '#post-page' } }) }} {{ form_close() }}
{% partial 'site/footer' %}