diff --git a/plugins/ahmadfatoni/apigenerator/controllers/api/postsController.php b/plugins/ahmadfatoni/apigenerator/controllers/api/postsController.php
index 5479a9c54..aacd3e605 100644
--- a/plugins/ahmadfatoni/apigenerator/controllers/api/postsController.php
+++ b/plugins/ahmadfatoni/apigenerator/controllers/api/postsController.php
@@ -24,7 +24,7 @@ class postsController extends Controller
//postes list
public function index(){
$path = Config::get('app.cdn').Config::get('cms.storage.media.path');
- $data = $this->Post::with(['categories:id,name'])->listFrontEnd([
+ $filter = [
'page' => input('page'),
'sort' => input('sort')??'published_at desc',
'perPage' => input('count'),
@@ -32,11 +32,16 @@ class postsController extends Controller
'category' => input('category'),
'date' => input('date'),
'typePost' => input('typePost'),
- 'postGroup' => empty(input('group')) ? null : input('group'),
+ 'postGroup' => input('group'),
'published' => true,
- 'featured' => input('featured') == true ? 1 : 0,
'select' => ['id','title','slug','published_at', 'more_photo', DB::raw("IF(featured_image<>'',concat('$path',featured_image),featured_image) as main_image")]
- ]);
+ ];
+
+ if(request()->has('featured')){
+ $filter['featured'] = true;
+ }
+
+ $data = $this->Post::with(['categories:id,name'])->listFrontEnd($filter);
if($data){
$data->each(function ($item, $key) {
diff --git a/plugins/rainlab/blog/models/post/columns.yaml b/plugins/rainlab/blog/models/post/columns.yaml
index 6eeb35ecc..88bf255dc 100644
--- a/plugins/rainlab/blog/models/post/columns.yaml
+++ b/plugins/rainlab/blog/models/post/columns.yaml
@@ -10,7 +10,7 @@ columns:
categories:
label: 'rainlab.blog::lang.post.categories'
type: text
- searchable: true
+ searchable: false
select: name
relation: categories
locale:
@@ -21,35 +21,35 @@ columns:
type: number
created_at:
label: 'rainlab.blog::lang.post.created'
- type: date
+ type: datetime
invisible: true
updated_at:
label: 'rainlab.blog::lang.post.updated'
- type: date
+ type: datetime
invisible: true
published_at:
label: 'rainlab.blog::lang.post.published'
- type: date
+ type: datetime
featured:
label: Featured
type: switch
user_id:
label: Author
type: text
- searchable: true
+ searchable: false
sortable: true
select: login
relation: user
type_post:
label: 'Main Cat'
type: text
- searchable: true
+ searchable: false
invisible: true
sortable: true
category_group:
label: 'Cat Group'
type: text
- searchable: true
+ searchable: false
sortable: true
select: name
relation: category_groups
diff --git a/themes/modern2/pages/new/afisha-post.htm b/themes/modern2/pages/new/afisha-post.htm
index 661137142..2a3168cf6 100644
--- a/themes/modern2/pages/new/afisha-post.htm
+++ b/themes/modern2/pages/new/afisha-post.htm
@@ -1,4 +1,4 @@
-title = "new/afisha-post"
+title = "Афиша"
url = "/new/afisha-post/:id/:slug"
layout = "new/master-inside"
is_hidden = 0
@@ -12,6 +12,9 @@ slug = "{{ :slug }}"
slug = "{{ :slug }}"
id = "{{ :id }}"
categoryPage = 404
+
+[SeoBlogPost]
+post = "post"
==
{% endput %}
-
+{% component 'SeoBlogPost' %}
{% set post = blogPost.post %}