from server 18
This commit is contained in:
parent
d65495c00f
commit
bd707d8c2e
|
|
@ -85,6 +85,12 @@ class Posts extends ComponentBase
|
|||
'type' => 'string',
|
||||
'default' => '',
|
||||
],
|
||||
'categoryGroup' => [
|
||||
'title' => 'categoryGroup',
|
||||
'description' => 'categoryGroup',
|
||||
'type' => 'string',
|
||||
'default' => '',
|
||||
],
|
||||
'typePost' => [
|
||||
'title' => 'typePost',
|
||||
'description' => 'typePost',
|
||||
|
|
@ -223,6 +229,7 @@ class Posts extends ComponentBase
|
|||
'perPage' => $this->property('postsPerPage'),
|
||||
'featured' => $featured,
|
||||
'typePost' => empty($this->property('typePost')) ? null : $this->property('typePost'),
|
||||
'group' => empty($this->property('categoryGroup')) ? null : $this->property('categoryGroup'),
|
||||
'search' => trim(input('q')),
|
||||
'category' => $category,
|
||||
'date' => input('date'),
|
||||
|
|
@ -234,7 +241,7 @@ class Posts extends ComponentBase
|
|||
? $this->property('exceptCategories')
|
||||
: preg_split('/,\s*/', $this->property('exceptCategories'), -1, PREG_SPLIT_NO_EMPTY),
|
||||
]);
|
||||
|
||||
//dd($this->property('categoryGroup'));
|
||||
/*
|
||||
* Add a "url" helper attribute for linking to each post and category
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
items:
|
||||
-
|
||||
title: Новости
|
||||
nesting: null
|
||||
type: url
|
||||
url: /ru/new/posts/news
|
||||
code: ''
|
||||
reference: null
|
||||
cmsPage: null
|
||||
replace: null
|
||||
viewBag:
|
||||
locale:
|
||||
en:
|
||||
|
|
@ -18,9 +22,13 @@ items:
|
|||
items:
|
||||
-
|
||||
title: События
|
||||
nesting: null
|
||||
type: url
|
||||
url: /ru/new/posts/news/events
|
||||
code: ''
|
||||
reference: null
|
||||
cmsPage: null
|
||||
replace: null
|
||||
viewBag:
|
||||
locale:
|
||||
en:
|
||||
|
|
@ -34,9 +42,13 @@ items:
|
|||
isExternal: '0'
|
||||
-
|
||||
title: Watan
|
||||
nesting: null
|
||||
type: url
|
||||
url: /ru/new/posts/news/watan
|
||||
code: ''
|
||||
reference: null
|
||||
cmsPage: null
|
||||
replace: null
|
||||
viewBag:
|
||||
locale:
|
||||
en:
|
||||
|
|
@ -52,7 +64,7 @@ items:
|
|||
title: Экономика
|
||||
nesting: null
|
||||
type: url
|
||||
url: /new/group/news/economy
|
||||
url: /ru/new/posts/news/economy
|
||||
code: ''
|
||||
reference: null
|
||||
cmsPage: null
|
||||
|
|
@ -72,7 +84,7 @@ items:
|
|||
title: Общество
|
||||
nesting: null
|
||||
type: url
|
||||
url: /new/group/news/society
|
||||
url: /ru/new/posts/news/society
|
||||
code: ''
|
||||
reference: null
|
||||
cmsPage: null
|
||||
|
|
@ -90,9 +102,13 @@ items:
|
|||
isExternal: '0'
|
||||
-
|
||||
title: Статьи
|
||||
nesting: null
|
||||
type: url
|
||||
url: /ru/new/posts/stati
|
||||
code: ''
|
||||
reference: null
|
||||
cmsPage: null
|
||||
replace: null
|
||||
viewBag:
|
||||
locale:
|
||||
en:
|
||||
|
|
@ -107,9 +123,13 @@ items:
|
|||
items:
|
||||
-
|
||||
title: Экономика
|
||||
nesting: null
|
||||
type: url
|
||||
url: /ru/new/posts/stati/economy
|
||||
code: ''
|
||||
reference: null
|
||||
cmsPage: null
|
||||
replace: null
|
||||
viewBag:
|
||||
locale:
|
||||
en:
|
||||
|
|
@ -124,12 +144,12 @@ items:
|
|||
-
|
||||
title: Экомир
|
||||
nesting: null
|
||||
type: category-blog-posts
|
||||
url: null
|
||||
type: url
|
||||
url: /ru/new/posts/stati/eco-world
|
||||
code: ''
|
||||
reference: '13'
|
||||
cmsPage: new/newPost
|
||||
replace: 0
|
||||
reference: null
|
||||
cmsPage: null
|
||||
replace: null
|
||||
viewBag:
|
||||
locale:
|
||||
en:
|
||||
|
|
@ -143,9 +163,13 @@ items:
|
|||
isExternal: '0'
|
||||
-
|
||||
title: Технологии
|
||||
nesting: null
|
||||
type: url
|
||||
url: /ru/new/posts/stati/technology
|
||||
code: ''
|
||||
reference: null
|
||||
cmsPage: null
|
||||
replace: null
|
||||
viewBag:
|
||||
locale:
|
||||
en:
|
||||
|
|
@ -160,12 +184,12 @@ items:
|
|||
-
|
||||
title: Спорт
|
||||
nesting: null
|
||||
type: category-blog-posts
|
||||
url: null
|
||||
type: url
|
||||
url: /ru/new/posts/stati/sport
|
||||
code: ''
|
||||
reference: '10'
|
||||
cmsPage: new/newPost
|
||||
replace: 0
|
||||
reference: null
|
||||
cmsPage: null
|
||||
replace: null
|
||||
viewBag:
|
||||
locale:
|
||||
en:
|
||||
|
|
@ -180,12 +204,12 @@ items:
|
|||
-
|
||||
title: События
|
||||
nesting: null
|
||||
type: category-blog-posts
|
||||
url: null
|
||||
type: url
|
||||
url: /ru/new/posts/stati/events
|
||||
code: ''
|
||||
reference: '9'
|
||||
cmsPage: new/newPost
|
||||
replace: 0
|
||||
reference: null
|
||||
cmsPage: null
|
||||
replace: null
|
||||
viewBag:
|
||||
locale:
|
||||
en:
|
||||
|
|
@ -200,12 +224,12 @@ items:
|
|||
-
|
||||
title: Полезное
|
||||
nesting: null
|
||||
type: category-blog-posts
|
||||
url: null
|
||||
type: url
|
||||
url: /ru/new/posts/stati/poleznoe
|
||||
code: ''
|
||||
reference: '803'
|
||||
cmsPage: new/newPost
|
||||
replace: 0
|
||||
reference: null
|
||||
cmsPage: null
|
||||
replace: null
|
||||
viewBag:
|
||||
locale:
|
||||
en:
|
||||
|
|
@ -239,13 +263,9 @@ items:
|
|||
isExternal: '0'
|
||||
-
|
||||
title: Афиша
|
||||
nesting: null
|
||||
type: url
|
||||
url: /
|
||||
url: /ru/new/posts/poster
|
||||
code: ''
|
||||
reference: null
|
||||
cmsPage: null
|
||||
replace: null
|
||||
viewBag:
|
||||
locale:
|
||||
en:
|
||||
|
|
@ -257,6 +277,103 @@ items:
|
|||
isHidden: '0'
|
||||
cssClass: ''
|
||||
isExternal: '0'
|
||||
items:
|
||||
-
|
||||
title: Театры
|
||||
type: url
|
||||
url: /ru/new/posts/poster/teatry
|
||||
code: ''
|
||||
viewBag:
|
||||
locale:
|
||||
en:
|
||||
title: ''
|
||||
url: ''
|
||||
tm:
|
||||
title: ''
|
||||
url: ''
|
||||
isHidden: '0'
|
||||
cssClass: ''
|
||||
isExternal: '0'
|
||||
-
|
||||
title: Спорт
|
||||
type: url
|
||||
url: /ru/new/posts/poster/sport
|
||||
code: ''
|
||||
viewBag:
|
||||
locale:
|
||||
en:
|
||||
title: ''
|
||||
url: ''
|
||||
tm:
|
||||
title: ''
|
||||
url: ''
|
||||
isHidden: '0'
|
||||
cssClass: ''
|
||||
isExternal: '0'
|
||||
-
|
||||
title: Объявления
|
||||
type: url
|
||||
url: /ru/new/posts/poster/obyavleniya
|
||||
code: ''
|
||||
viewBag:
|
||||
locale:
|
||||
en:
|
||||
title: ''
|
||||
url: ''
|
||||
tm:
|
||||
title: ''
|
||||
url: ''
|
||||
isHidden: '0'
|
||||
cssClass: ''
|
||||
isExternal: '0'
|
||||
-
|
||||
title: Концерты
|
||||
type: url
|
||||
url: /ru/new/posts/poster/koncerty
|
||||
code: ''
|
||||
viewBag:
|
||||
locale:
|
||||
en:
|
||||
title: ''
|
||||
url: ''
|
||||
tm:
|
||||
title: ''
|
||||
url: ''
|
||||
isHidden: '0'
|
||||
cssClass: ''
|
||||
isExternal: '0'
|
||||
-
|
||||
title: Кинотеатры
|
||||
type: url
|
||||
url: /ru/new/posts/poster/kinoteatry
|
||||
code: ''
|
||||
viewBag:
|
||||
locale:
|
||||
en:
|
||||
title: ''
|
||||
url: ''
|
||||
tm:
|
||||
title: ''
|
||||
url: ''
|
||||
isHidden: '0'
|
||||
cssClass: ''
|
||||
isExternal: '0'
|
||||
-
|
||||
title: Выставки
|
||||
type: url
|
||||
url: /ru/new/posts/poster/vystavki
|
||||
code: ''
|
||||
viewBag:
|
||||
locale:
|
||||
en:
|
||||
title: ''
|
||||
url: ''
|
||||
tm:
|
||||
title: ''
|
||||
url: ''
|
||||
isHidden: '0'
|
||||
cssClass: ''
|
||||
isExternal: '0'
|
||||
-
|
||||
title: Контакты
|
||||
nesting: null
|
||||
|
|
|
|||
|
|
@ -0,0 +1,92 @@
|
|||
title = "new/afisha-post"
|
||||
url = "/new/afisha-post/:id/:slug"
|
||||
layout = "new/master-inside"
|
||||
is_hidden = 0
|
||||
robot_index = "index"
|
||||
robot_follow = "follow"
|
||||
|
||||
[views]
|
||||
slug = "{{ :slug }}"
|
||||
|
||||
[blogPost]
|
||||
slug = "{{ :slug }}"
|
||||
id = "{{ :id }}"
|
||||
categoryPage = 404
|
||||
==
|
||||
{% put styles %}
|
||||
|
||||
<style>
|
||||
p img {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
{% endput %}
|
||||
|
||||
{% set post = blogPost.post %}
|
||||
|
||||
<main class="affiche-item">
|
||||
<div class="container">
|
||||
<div class="affiche-item-inner">
|
||||
<div class="affiche-item-content">
|
||||
|
||||
<div class="affiche-item-head">
|
||||
<h1>
|
||||
{{post.title}}
|
||||
</h1>
|
||||
<span>{{post.published_at|date('d.m.Y')}} | {{post.published_at|date('H:i')}}</span>
|
||||
</div>
|
||||
|
||||
<div class="affiche-item-item">
|
||||
<div class="affiche-item-top">
|
||||
<div class="affiche-item-data">
|
||||
<div class="affiche-item-data">
|
||||
|
||||
{% if post.afisha_address %}
|
||||
<div class="affiche-item-data-row">
|
||||
<div class="affiche-item-data-img">
|
||||
<img src="{{'assets/new/icons/location.svg'|theme}}" alt="" />
|
||||
</div>
|
||||
<span>{{ post.afisha_address }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if post.afisha_address %}
|
||||
<div class="affiche-item-data-row">
|
||||
<div class="affiche-item-data-img">
|
||||
<img src="{{'assets/new/icons/phone.svg'|theme}}" alt="" />
|
||||
</div>
|
||||
<span>{{ post.afisha_phone }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="affiche-item-data-row">
|
||||
<div class="affiche-item-data-img">
|
||||
<img src="{{'assets/new/icons/eye.svg'|theme}}" alt="" />
|
||||
</div>
|
||||
<span>1938</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="affiche-item-img">
|
||||
{% if post.featured_image %}
|
||||
<img src="{{post.featured_image|media}}" alt="{{post.title}}" />
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="affiche-item-bottom">
|
||||
{{post.content|md}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
{% partial 'newHome/right-sidebar.htm' class="article-aside" %}
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
{% put scripts %}
|
||||
<script src="{{'assets/new/scripts/core/affiche-item.js'|theme}}"></script>
|
||||
{% endput %}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
title = "new/afisha"
|
||||
url = "/new/afisha/:slug"
|
||||
layout = "new/master-inside"
|
||||
is_hidden = 0
|
||||
robot_index = "index"
|
||||
robot_follow = "follow"
|
||||
|
||||
[blogPosts]
|
||||
pageNumber = "{{ :page }}"
|
||||
categoryFilter = "{{ :slug }}"
|
||||
postsPerPage = 10
|
||||
noPostsMessage = "No posts found"
|
||||
sortOrder = "published_at desc"
|
||||
categoryPage = 404
|
||||
postPage = 404
|
||||
==
|
||||
<main class="affiche">
|
||||
<div class="container">
|
||||
<div class="affiche-inner">
|
||||
<div class="trending-head affiche-head">
|
||||
<h2>Афиша</h2>
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="rubric-items affiche-items">
|
||||
|
||||
{% for post in blogPosts.posts %}
|
||||
{% partial 'new/afisha-item' post = post %}
|
||||
{% else %}
|
||||
<p>No posts found</p>
|
||||
{% endfor %}
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
{% partial 'new/pagination' items = blogPosts.posts %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
title = "new/group/category"
|
||||
url = "/new/posts/:group/:slug?"
|
||||
url = "/new/posts/:categoryGroup/:slug?"
|
||||
layout = "new/master-inside"
|
||||
is_hidden = 0
|
||||
robot_index = "index"
|
||||
|
|
@ -8,6 +8,7 @@ robot_follow = "follow"
|
|||
[blogPosts]
|
||||
pageNumber = "{{ :page }}"
|
||||
categoryFilter = "{{ :slug }}"
|
||||
Group Filter = "{{ :categoryGroup }}"
|
||||
postsPerPage = 10
|
||||
noPostsMessage = "No posts found"
|
||||
sortOrder = "published_at desc"
|
||||
|
|
@ -15,11 +16,12 @@ categoryPage = "new/category"
|
|||
postPage = "new/newPost"
|
||||
==
|
||||
<?php
|
||||
function onStart(){
|
||||
//function onStart(){
|
||||
//$this['backendUsers'] = Backend\Models\User::all();
|
||||
$this['group'] = $this->param('group');
|
||||
|
||||
}
|
||||
// $this['group'] = $this->param('categoryGroup');
|
||||
// $this['groupName'] = RainLab\Blog\Models\CategoryGroup::where('slug', $this['group'])->first();
|
||||
//dd( $this['groupName']);
|
||||
//}
|
||||
?>
|
||||
==
|
||||
<!-- HEAD end ======== -->
|
||||
|
|
@ -27,7 +29,7 @@ function onStart(){
|
|||
<div class="container">
|
||||
<div class="rubric-inner">
|
||||
<div class="trending-head">
|
||||
<h2>{{category.name}}</h2>
|
||||
<h2>{% if category.name != "" %}{{category.name}}{% else %} {{ groupName.name }} {% endif %}</h2>
|
||||
<!-- <h2>{{ group }}</h2> -->
|
||||
<span></span>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
[viewBag]
|
||||
==
|
||||
<a href="{{'new/afisha-post'|page({id:post.id,slug:post.slug})}}" class="sub-news-left-content-item rubric-item affiche-item">
|
||||
<div class="sub-news-left-content-item-img">
|
||||
{% if post.featured_image %}
|
||||
<img src="{{post.featured_image|media|resize(350, 200)}}" alt="{{post.title}}" />
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="sub-news-left-content-item-content">
|
||||
<div class="sub-news-left-content-item-date-content-head">
|
||||
<h4>{{post.published_at|date('d.m.Y')}}</h4>
|
||||
<span>|</span>
|
||||
<h4>{{post.published_at|date('H:i')}}</h4>
|
||||
</div>
|
||||
<h3> {{post.title}}</h3>
|
||||
<div class="affiche-item-data">
|
||||
|
||||
{% if post.afisha_address %}
|
||||
<div class="affiche-item-data-row">
|
||||
<div class="affiche-item-data-img">
|
||||
<img src="{{'assets/new/icons/location.svg'|theme}}" alt="" />
|
||||
</div>
|
||||
<span>{{ post.afisha_address }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if post.afish_phone %}
|
||||
<div class="affiche-item-data-row">
|
||||
<div class="affiche-item-data-img">
|
||||
<img src="{{'assets/new/icons/phone.svg'|theme}}" alt="" />
|
||||
</div>
|
||||
<span>{{ post.afish_phone }}</span>
|
||||
</div>
|
||||
{%endif%}
|
||||
|
||||
<div class="affiche-item-data-row">
|
||||
<div class="affiche-item-data-img">
|
||||
<img src="{{'assets/new/icons/eye.svg'|theme}}" alt="" />
|
||||
</div>
|
||||
<span>1938</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
<?php
|
||||
function onStart(){
|
||||
|
||||
$this['afisha'] = RainLab\Blog\Models\CategoryGroup::where('slug', 'afisha')->with('category_items')->first();
|
||||
$this['afisha'] = RainLab\Blog\Models\CategoryGroup::where('slug', 'poster')->with('category_items')->first();
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
@ -36,7 +36,7 @@ $this['afisha'] = RainLab\Blog\Models\CategoryGroup::where('slug', 'afisha')->wi
|
|||
<h2>{{afisha.name}}</h2>
|
||||
<div class="sub-news-right-bottom-content">
|
||||
{% for category in afisha.category_items %}
|
||||
<a href="{{ 'new/category'|page({slug:category.slug}) }}" class="sub-news-right-bottom-item">{{ category.name }}</a>
|
||||
<a href="{{ 'new/afisha'|page({slug:category.slug}) }}" class="sub-news-right-bottom-item">{{ category.name }}</a>
|
||||
{% else %}
|
||||
|
||||
<a href="#" class="sub-news-right-bottom-item">No Record</a>
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ postPage = 404
|
|||
|
||||
{% for post in mediaPosts %}
|
||||
|
||||
{% partial 'newHome/media-post-item' post=post %}
|
||||
{% partial 'newHome/post-item-img-cat' post=post categoryHidden=true %}
|
||||
|
||||
{% endfor %}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,11 @@
|
|||
</div>
|
||||
<div class="trending-main-content-inner">
|
||||
<div class="sub-news-left-content-item-date-content-head trending-aside-content-head">
|
||||
<h3>{{post.categories.implode('name', ', ')}}</h3>
|
||||
<span>|</span>
|
||||
{% if not categoryHidden %}
|
||||
<h3>{{post.categories.implode('name', ', ')}}</h3>
|
||||
<span>|</span>
|
||||
{% endif %}
|
||||
|
||||
<h4>{{post.published_at|date('d.m.Y')}}</h4>
|
||||
<span>|</span>
|
||||
<h4> {{post.published_at|date('H:i')}}</h4>
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ exceptPost = "{{ :id }}"
|
|||
|
||||
{% endfor %}
|
||||
|
||||
<a href="/new/typePost/turkmenistan" class="aside-content-more">
|
||||
<a href="/new/posts/news" class="aside-content-more">
|
||||
<span>{{'new.read.more'|_}}</span>
|
||||
<div class="aside-content-more-img">
|
||||
<img src="{{'assets/new/icons/arrow-right-black.svg'|theme}}" alt="" />
|
||||
|
|
@ -59,7 +59,7 @@ exceptPost = "{{ :id }}"
|
|||
{% endfor %}
|
||||
|
||||
|
||||
<a href="/new/typePost/world" class="aside-content-more">
|
||||
<a href="/new/posts/news" class="aside-content-more">
|
||||
<span>{{'new.read.more'|_}}</span>
|
||||
<div class="aside-content-more-img">
|
||||
<img src="{{'assets/new/icons/arrow-right-black.svg'|theme}}" alt="" />
|
||||
|
|
|
|||
Loading…
Reference in New Issue