This commit is contained in:
Kerim 2023-03-24 11:24:37 +05:00
commit cc4f3bd791
6 changed files with 33 additions and 30 deletions

View File

@ -54,8 +54,10 @@ class postsController extends Controller
//posts item //posts item
public function show($locale,$id){ 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)) { if(!is_null($post)) {

View File

@ -30,7 +30,7 @@ random = 0
<div class="container"> <div class="container">
<div class="trending-inner"> <div class="trending-inner">
<div class="trending-aside"> <div class="trending-aside">
<div class="trending-head"> <div class="trending-head" style="width: 116rem;">
<h2><a href="{{'new/group'|page({categoryGroup: 'stati', slug:'ot-redaktora'})}}">{{ 'new.home.ot.redaktora'|_ }}</a></h2> <h2><a href="{{'new/group'|page({categoryGroup: 'stati', slug:'ot-redaktora'})}}">{{ 'new.home.ot.redaktora'|_ }}</a></h2>
<span></span> <span></span>
</div> </div>

View File

@ -10,23 +10,14 @@ $this['afisha'] = RainLab\Blog\Models\CategoryGroup::where('slug', 'poster')->wi
== ==
<div class="sub-news-right"> <div class="sub-news-right">
<div class="sub-news-right-top"> <div class="sub-news-right-top">
<h2><a href="{{'new/group'|page({categoryGroup: 'news', slug:'watan'})}}">{{'new.home.page.right'|_ }}</a></h2> <h2>{{'new.home.page.right'|_ }}</h2>
<div class="sub-news-right-top-content"> <div class="sub-news-right-top-content">
{% for post in categoryPosts %} {% for post in categoryPosts %}
<a href="{{'new/newPost'|page({id:post.id,slug:post.slug})}}" class="sub-news-left-content-item sub-news-right-top-item">
<div class="sub-news-left-content-item-content">
<div class="sub-news-left-content-item-date-content-head"> {% partial 'newHome/post-item-img' post=post %}
<h4>{{ post.published_at| date('d.m.Y')}}</h4>
<span>|</span>
<h4>{{post.published_at|date('H:i')}}</h4>
</div>
<p class="sub-news-left-content-item-date-content-info">
{{post.title}}
</p>
</div>
</a>
{% endfor %} {% endfor %}

View File

@ -3,7 +3,7 @@
[blogPosts postsMainLeft] [blogPosts postsMainLeft]
pageNumber = "{{ :page }}" pageNumber = "{{ :page }}"
categoryFilter = "novosti-biznesa" categoryFilter = "novosti-biznesa"
postsPerPage = 5 postsPerPage = 6
noPostsMessage = "No posts found" noPostsMessage = "No posts found"
sortOrder = "published_at desc" sortOrder = "published_at desc"
categoryPage = 404 categoryPage = 404
@ -22,9 +22,16 @@ postPage = 404
code = 2 code = 2
type = "slider" type = "slider"
random = 0 random = 0
[popularPosts]
category = "{{ :category }}"
postsLimit = 5
noPostsMessage = "No posts found"
postPage = 404
== ==
{% set postsMainLeft = postsMainLeft.posts %} {% set postsMainLeft = postsMainLeft.posts %}
{% set postsMainRight = postsMainRight.posts %} {% set postsMainRight = postsMainRight.posts %}
{% set populars = popularPosts.posts %}
@ -81,7 +88,7 @@ random = 0
{% partial 'newHome/main-bussiness' categoryPosts = postsMainLeft %} {% partial 'newHome/main-bussiness' categoryPosts = postsMainLeft %}
{% partial 'newHome/main-tender' categoryPosts = postsMainRight %} {% partial 'newHome/main-tender' categoryPosts = populars %}
</div> </div>
</div> </div>
@ -92,4 +99,4 @@ random = 0
</div> </div>
</main> </main>
<!-- MAIN end ======== --> <!-- MAIN end ======== -->

View File

@ -1,22 +1,25 @@
[viewBag] [viewBag]
[popularPosts] [blogPosts popularPosts]
category = "{{ :category }}" pageNumber = "{{ :page }}"
postsLimit = 5 categoryFilter = "ot-redaktora"
postsPerPage = 6
noPostsMessage = "No posts found" noPostsMessage = "No posts found"
postPage = "new/newPost" sortOrder = "published_at desc"
categoryPage = 404
postPage = 404
== ==
{% set posts = popularPosts.posts %} {% set posts = popularPosts.posts %}
<div class="trending-main"> <div class="trending-main" style="margin-top: 60px;">
<div class="trending-head"> <!-- <div class="trending-head">
<h2>{{ 'new.page.samoe.chitaemoe'|_ }}</h2> <h2>{{ 'new.page.samoe.chitaemoe'|_ }}</h2>
<span></span> <span></span>
</div> </div> -->
<div class="trending-main-content"> <div class="trending-main-content" style="height: 77% !important;">
{% for post in posts %} {% for post in posts.slice(1,6) %}
{% partial 'newHome/post-item-img' post = post %} {% partial 'newHome/post-item-img' post = post %}

View File

@ -5,7 +5,7 @@ pageNumber = "{{ :page }}"
typePost = "turkmenistan" typePost = "turkmenistan"
postsPerPage = 6 postsPerPage = 6
noPostsMessage = "No posts found" noPostsMessage = "No posts found"
sortOrder = "created_at desc" sortOrder = "published_at desc"
categoryPage = 404 categoryPage = 404
postPage = 404 postPage = 404
exceptPost = "{{ :id }}" exceptPost = "{{ :id }}"