From bceef69a72c38f576c3180efbaddeddafd0c6fb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Kv=C3=A1=C4=8Dek?= Date: Fri, 7 Oct 2016 10:32:46 +0200 Subject: [PATCH] FEATURE: add categories into article detail and article list --- modules/Blog/ArticleList/Handlers/ArticleList.php | 2 +- .../views/modules/article/visitor/default.blade.php | 7 +++++++ .../views/modules/articlelist/visitor/default.blade.php | 8 +++++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/modules/Blog/ArticleList/Handlers/ArticleList.php b/modules/Blog/ArticleList/Handlers/ArticleList.php index b1bfd0d8..c65ba273 100644 --- a/modules/Blog/ArticleList/Handlers/ArticleList.php +++ b/modules/Blog/ArticleList/Handlers/ArticleList.php @@ -70,7 +70,7 @@ class ArticleList extends Handler ->enabled() ) { $category = Category::where('url', $categoryUrl) - ->first(); + ->firstOrFail(); $subcategories = $category->getChildren() ->toArray(); diff --git a/templates/Binarity/Resources/views/modules/article/visitor/default.blade.php b/templates/Binarity/Resources/views/modules/article/visitor/default.blade.php index afdd80d5..69a93026 100644 --- a/templates/Binarity/Resources/views/modules/article/visitor/default.blade.php +++ b/templates/Binarity/Resources/views/modules/article/visitor/default.blade.php @@ -17,6 +17,13 @@ {{$page->author->name}} + @if($page->category) +
+ {{$page->category->name}} +
+ @endif + + @if(isset($page->module_settings->allowComments) && $page->module_settings->allowComments != 0)
{{$page->comments->count()}} diff --git a/templates/Binarity/Resources/views/modules/articlelist/visitor/default.blade.php b/templates/Binarity/Resources/views/modules/articlelist/visitor/default.blade.php index 17b9595a..4baba499 100644 --- a/templates/Binarity/Resources/views/modules/articlelist/visitor/default.blade.php +++ b/templates/Binarity/Resources/views/modules/articlelist/visitor/default.blade.php @@ -37,8 +37,14 @@ vĂ­ce - @if(isset($article->module_settings->allowComments) && $article->module_settings->allowComments != 0) + @if(isset($article->module_settings->allowComments) && $article->module_settings->allowComments != 0 || $article->category)