diff --git a/plugins/ahmadfatoni/apigenerator/controllers/api/postsController.php b/plugins/ahmadfatoni/apigenerator/controllers/api/postsController.php index 74d2f60b6..f93ef2370 100644 --- a/plugins/ahmadfatoni/apigenerator/controllers/api/postsController.php +++ b/plugins/ahmadfatoni/apigenerator/controllers/api/postsController.php @@ -31,14 +31,23 @@ class postsController extends Controller 'category' => input('category'), 'date' => input('date'), 'published' => true, - 'select' => ['id','title','published_at',DB::raw("IF(featured_image<>'',concat('$path',featured_image),featured_image) as main_image")] + 'select' => ['id','title','slug','published_at',DB::raw("IF(featured_image<>'',concat('$path',featured_image),featured_image) as main_image")] ]); + + if($data){ + $data->each(function ($item, $key) { + $item->url = $this->pageUrl('post',['id'=>$item->id,'slug'=>$item->slug]); + }); + } + return $this->helpers->apiArrayResponseBuilder(200, 'success', $data); } public function show($locale,$id){ - $post = $this->Post::find($id,['id','content_html','author']); + $post = $this->Post::find($id,['id','content_html','author','slug']); + + $post->url = $this->pageUrl('post',['id'=>$post->id,'slug'=>$post->slug]); if(!is_null($post)) { $obj = Db::table('vdomah_blogviews_views') diff --git a/plugins/suresoftware/powerseo/components/CmsPage.php b/plugins/suresoftware/powerseo/components/CmsPage.php index 0f2b43791..3051302c9 100644 --- a/plugins/suresoftware/powerseo/components/CmsPage.php +++ b/plugins/suresoftware/powerseo/components/CmsPage.php @@ -66,6 +66,11 @@ class CmsPage extends ComponentBase } else { //todo els if has category component $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); + } } } diff --git a/themes/modern2/assets/js/main.js b/themes/modern2/assets/js/main.js index e193fd9c8..7abc5c1ac 100644 --- a/themes/modern2/assets/js/main.js +++ b/themes/modern2/assets/js/main.js @@ -19,7 +19,8 @@ $(".swiper-wrapper").slick({ slidesToScroll: 1, arrows: true, infinite: true, - + autoplay: true, + speed: 500, prevArrow: $(".p3"), nextArrow: $(".n3"), });