2022-12-06 15:33:01 +00:00
|
|
|
title = "newPost"
|
|
|
|
|
url = "/new/post/:id/:slug"
|
2022-12-16 06:59:28 +00:00
|
|
|
layout = "new/master-inside"
|
2022-12-06 15:33:01 +00:00
|
|
|
is_hidden = 0
|
|
|
|
|
robot_index = "index"
|
|
|
|
|
robot_follow = "follow"
|
|
|
|
|
|
|
|
|
|
[views]
|
|
|
|
|
slug = "{{ :slug }}"
|
|
|
|
|
|
|
|
|
|
[blogPost]
|
|
|
|
|
slug = "{{ :slug }}"
|
|
|
|
|
id = "{{ :id }}"
|
2022-12-19 20:27:54 +00:00
|
|
|
categoryPage = 404
|
|
|
|
|
==
|
|
|
|
|
<?php
|
|
|
|
|
function onStart(){
|
|
|
|
|
//dd($this->page->blogPost);
|
|
|
|
|
|
|
|
|
|
$postId = $this->param('id');
|
|
|
|
|
$currentPost = RainLab\Blog\Models\Post::where('id', $postId)->with(['category_groups'])->first();
|
|
|
|
|
|
|
|
|
|
if($this->menuItems && $postId && $currentPost && $currentPost->category_groups){
|
|
|
|
|
|
|
|
|
|
$currentGroup = $currentPost->category_groups[0]->name;
|
|
|
|
|
|
|
|
|
|
foreach ($this->menuItems as $menu){
|
|
|
|
|
//dump($menu->title);
|
|
|
|
|
|
|
|
|
|
if($menu->title === $currentGroup){
|
|
|
|
|
$menu->isActive = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
?>
|
2022-12-06 15:33:01 +00:00
|
|
|
==
|
|
|
|
|
{% put styles %}
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
p img {
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
{% endput %}
|
|
|
|
|
|
|
|
|
|
{% set post = blogPost.post %}
|
|
|
|
|
|
|
|
|
|
<main class="article">
|
|
|
|
|
<div class="container">
|
|
|
|
|
<div class="article-inner">
|
|
|
|
|
<div class="article-content">
|
|
|
|
|
<div class="article-content-top">
|
|
|
|
|
<div class="article-head">
|
|
|
|
|
<h2>
|
|
|
|
|
{{post.title}}
|
|
|
|
|
</h2>
|
|
|
|
|
<span>{{post.published_at|date('d.m.Y')}} | {{post.published_at|date('H:i')}}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="article-swiper-wrapper">
|
|
|
|
|
<div class="swiper articleSwiper">
|
|
|
|
|
<div class="swiper-wrapper">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="swiper-slide">
|
|
|
|
|
<div class="article-item">
|
|
|
|
|
<img src="{{post.featured_image|media_cdn|resize(1112)}}" alt=" {{post.title}}" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
<div class="photo-prev video-prev article-prev">
|
|
|
|
|
<img src="{{'assets/new/icons/arrow-left-white.svg'|theme}}" alt="" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="photo-next video-next article-next">
|
|
|
|
|
<img src="{{'assets/new/icons/arrow-right-white.svg'|theme}}" alt="" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="article-desc">
|
|
|
|
|
{{post.content|md}}
|
|
|
|
|
|
2022-12-14 15:55:13 +00:00
|
|
|
<!-- <h5>ORIENT NEWS</h5>
|
|
|
|
|
<h5>Фото: figma.com</h5> -->
|
2022-12-06 15:33:01 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{% partial 'new/social' %}
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{% partial 'new/post-featured' %}
|
|
|
|
|
|
|
|
|
|
</div>
|
2022-12-14 15:55:13 +00:00
|
|
|
{% partial 'newHome/right-sidebar.htm' class="article-aside" %}
|
2022-12-06 15:33:01 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</main>
|
|
|
|
|
|
|
|
|
|
{% put scripts %}
|
|
|
|
|
<script src="{{'assets/new/scripts/core/article.js'|theme}}"></script>
|
|
|
|
|
{% endput %}
|