diff --git a/plugins/ahmadfatoni/apigenerator/controllers/api/postsController.php b/plugins/ahmadfatoni/apigenerator/controllers/api/postsController.php
index 9cdcd9589..78cfce137 100644
--- a/plugins/ahmadfatoni/apigenerator/controllers/api/postsController.php
+++ b/plugins/ahmadfatoni/apigenerator/controllers/api/postsController.php
@@ -54,8 +54,10 @@ class postsController extends Controller
//posts item
public function show($locale,$id){
+ $path = Config::get('app.cdn').Config::get('cms.storage.media.path');
+ //$post = $this->Post::find($id,['id','content_html','author','slug', 'afisha_phone', 'afisha_address', 'afisha_phone_new']);
+ $post = $this->Post::where('id', $id)->select('id', 'content_html', 'author', 'title','slug','published_at', 'more_photo','afisha_phone', 'afisha_address', 'afisha_phone_new', DB::raw("IF(featured_image<>'',concat('$path',featured_image),featured_image) as main_image"))->with(['categories:id,name'])->first();
- $post = $this->Post::find($id,['id','content_html','author','slug', 'afisha_phone', 'afisha_address', 'afisha_phone_new',]);
if(!is_null($post)) {
diff --git a/themes/modern2/partials/newHome/main-popular.htm b/themes/modern2/partials/newHome/main-popular.htm
index 1b873f7e8..32b088726 100644
--- a/themes/modern2/partials/newHome/main-popular.htm
+++ b/themes/modern2/partials/newHome/main-popular.htm
@@ -30,7 +30,7 @@ random = 0
-
+
diff --git a/themes/modern2/partials/newHome/main-tender.htm b/themes/modern2/partials/newHome/main-tender.htm
index dc9a5ec4f..a39d47061 100644
--- a/themes/modern2/partials/newHome/main-tender.htm
+++ b/themes/modern2/partials/newHome/main-tender.htm
@@ -10,23 +10,14 @@ $this['afisha'] = RainLab\Blog\Models\CategoryGroup::where('slug', 'poster')->wi
==
-
+
{{'new.home.page.right'|_ }}
{% for post in categoryPosts %}
-
-
-
-
{{ post.published_at| date('d.m.Y')}}
- |
- {{post.published_at|date('H:i')}}
-
-
- {{post.title}}
-
-
-
+
+
+ {% partial 'newHome/post-item-img' post=post %}
{% endfor %}
diff --git a/themes/modern2/partials/newHome/main.htm b/themes/modern2/partials/newHome/main.htm
index 242a8fd3b..9a5dee771 100644
--- a/themes/modern2/partials/newHome/main.htm
+++ b/themes/modern2/partials/newHome/main.htm
@@ -3,7 +3,7 @@
[blogPosts postsMainLeft]
pageNumber = "{{ :page }}"
categoryFilter = "novosti-biznesa"
-postsPerPage = 5
+postsPerPage = 6
noPostsMessage = "No posts found"
sortOrder = "published_at desc"
categoryPage = 404
@@ -22,9 +22,16 @@ postPage = 404
code = 2
type = "slider"
random = 0
+
+[popularPosts]
+category = "{{ :category }}"
+postsLimit = 5
+noPostsMessage = "No posts found"
+postPage = 404
==
{% set postsMainLeft = postsMainLeft.posts %}
{% set postsMainRight = postsMainRight.posts %}
+{% set populars = popularPosts.posts %}
@@ -81,7 +88,7 @@ random = 0
{% partial 'newHome/main-bussiness' categoryPosts = postsMainLeft %}
- {% partial 'newHome/main-tender' categoryPosts = postsMainRight %}
+ {% partial 'newHome/main-tender' categoryPosts = populars %}
@@ -92,4 +99,4 @@ random = 0
-
+
\ No newline at end of file
diff --git a/themes/modern2/partials/newHome/popular-item.htm b/themes/modern2/partials/newHome/popular-item.htm
index d4b4b00e8..a771acef6 100644
--- a/themes/modern2/partials/newHome/popular-item.htm
+++ b/themes/modern2/partials/newHome/popular-item.htm
@@ -1,22 +1,25 @@
[viewBag]
-[popularPosts]
-category = "{{ :category }}"
-postsLimit = 5
+[blogPosts popularPosts]
+pageNumber = "{{ :page }}"
+categoryFilter = "ot-redaktora"
+postsPerPage = 6
noPostsMessage = "No posts found"
-postPage = "new/newPost"
+sortOrder = "published_at desc"
+categoryPage = 404
+postPage = 404
==
{% set posts = popularPosts.posts %}
-
-
-
{{ 'new.page.samoe.chitaemoe'|_ }}
-
-
-
+
+
+
- {% for post in posts %}
+ {% for post in posts.slice(1,6) %}
{% partial 'newHome/post-item-img' post = post %}
diff --git a/themes/modern2/partials/newHome/right-sidebar.htm b/themes/modern2/partials/newHome/right-sidebar.htm
index 5d486ca0a..58154ac43 100644
--- a/themes/modern2/partials/newHome/right-sidebar.htm
+++ b/themes/modern2/partials/newHome/right-sidebar.htm
@@ -5,7 +5,7 @@ pageNumber = "{{ :page }}"
typePost = "turkmenistan"
postsPerPage = 6
noPostsMessage = "No posts found"
-sortOrder = "created_at desc"
+sortOrder = "published_at desc"
categoryPage = 404
postPage = 404
exceptPost = "{{ :id }}"