title = "Афиша" 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 [SeoBlogPost] post = "post" == page->blogPost); $postId = $this->param('id'); $currentPost = RainLab\Blog\Models\Post::where('id', $postId)->with(['category_groups'])->first(); $this['featuredPosts'] = RainLab\Blog\Models\Post::with(['categories'])->where('id', $postId)->paginate(10); $catId = $this['featuredPosts'][0]->categories[0]->id; //dd($this['featuredPosts'][0]->categories[0]->slug); 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; } } } // dd($this['posts']); } ?> == {% put styles %} {% endput %} {% component 'SeoBlogPost' %} {% set post = blogPost.post %}

{{post.title}}

{{post.published_at|date('d.m.Y')}} | {{post.published_at|date('H:i')}}
{% if post.more_photo|length > 0 %} {% for img in post.more_photo %}
{{post.title}}
{% endfor %} {% else %}
{{post.title}}
{% endif %}
{% if post.afisha_address %}
{{ post.afisha_address }}
{% endif %} {% if post.afisha_phone %}
{{ post.afisha_phone }}
{% endif %}
{% partial 'view' %}
{{post.content|md}}
{% partial 'newHome/right-sidebar.htm' class="article-aside" %}
{% put scripts %} {% endput %}