server
This commit is contained in:
parent
cdb56dc40b
commit
89b00f3210
|
|
@ -41,11 +41,17 @@ class CmsPage extends ComponentBase
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onRun()
|
public function onRender()
|
||||||
{
|
{
|
||||||
$this->page["hasBlog"] = false;
|
$this->page["hasBlog"] = false;
|
||||||
|
|
||||||
if (!$this->page->page->hasComponent("SeoBlogPost")) {
|
if($this->page->page->hasComponent("blogPosts")){
|
||||||
|
$category = $this->page->page->components['blogPosts']->category;
|
||||||
|
$this->seo_title = $this->page["seo_title"] = $category ? $category->name : $this->page->meta_title;
|
||||||
|
$this->seo_description = $this->page["seo_description"] = $category ? $category->description : $this->page->meta_description;
|
||||||
|
$this->seo_keywords = $this->page["seo_keywords"] = $category ? $category->name :$this->page->seo_keywords;
|
||||||
|
}
|
||||||
|
else if (!$this->page->page->hasComponent("SeoBlogPost")) {
|
||||||
$this->seo_title = $this->page["seo_title"] = empty($this->page->meta_title) ? $this->page->title : $this->page->meta_title;
|
$this->seo_title = $this->page["seo_title"] = empty($this->page->meta_title) ? $this->page->title : $this->page->meta_title;
|
||||||
$this->seo_description = $this->page["seo_description"] = $this->page->meta_description;
|
$this->seo_description = $this->page["seo_description"] = $this->page->meta_description;
|
||||||
$this->seo_keywords = $this->page["seo_keywords"] = $this->page->seo_keywords;
|
$this->seo_keywords = $this->page["seo_keywords"] = $this->page->seo_keywords;
|
||||||
|
|
@ -67,10 +73,7 @@ class CmsPage extends ComponentBase
|
||||||
} else { //todo els if has category component
|
} else { //todo els if has category component
|
||||||
$this->hasBlog = $this->page["hasBlog"] = true;
|
$this->hasBlog = $this->page["hasBlog"] = true;
|
||||||
|
|
||||||
if($this->page->page->hasComponent("blogPosts")){
|
|
||||||
$this->seo_title = $this->page["seo_title"] = empty($this->page->meta_title) ? $this->page->title : $this->page->meta_title;
|
|
||||||
dd($this->page->page);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@ robot_follow = "follow"
|
||||||
|
|
||||||
[viewBag]
|
[viewBag]
|
||||||
localeTitle[en] = "Home"
|
localeTitle[en] = "Home"
|
||||||
|
localeMeta_title[en] = "All main news of Turkmenistan today. Latest news of the region."
|
||||||
|
localeMeta_description[en] = "Events. The main and latest news of politics for today. Latest political news of Turkmenistan"
|
||||||
|
|
||||||
[blogCategories]
|
[blogCategories]
|
||||||
slug = "{{ :slug }}"
|
slug = "{{ :slug }}"
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
[blogPosts]
|
[blogPosts]
|
||||||
pageNumber = "{{ :page }}"
|
pageNumber = "{{ :page }}"
|
||||||
postsPerPage = 6
|
postsPerPage = 10
|
||||||
noPostsMessage = "No posts found"
|
noPostsMessage = "No posts found"
|
||||||
sortOrder = "published_at desc"
|
sortOrder = "published_at desc"
|
||||||
categoryPage = "category"
|
categoryPage = "category"
|
||||||
|
|
@ -40,4 +40,4 @@ exceptPost = "{{ :id }}"
|
||||||
{{post.title}}
|
{{post.title}}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
Loading…
Reference in New Issue