diff --git a/app/Models/Content.php b/app/Models/Content.php index 6dee27a4..a91de453 100644 --- a/app/Models/Content.php +++ b/app/Models/Content.php @@ -62,6 +62,7 @@ class Content extends Model { return Content::where('status', '!=', Content::STATUS_DRAFT) ->select('contents.*') + ->with('author') ->join('modules', 'modules.handler', '=', 'contents.module_handler') ->where('language', LaravelLocalization::getCurrentLocale()) ->where('modules.enabled', true); diff --git a/modules/Blog/Article/Handlers/Article.php b/modules/Blog/Article/Handlers/Article.php index bc5481b9..44f4a1f9 100644 --- a/modules/Blog/Article/Handlers/Article.php +++ b/modules/Blog/Article/Handlers/Article.php @@ -27,6 +27,7 @@ class Article extends Handler implements ContentTitles $content->comments = []; if (isset($content->module_settings->allowComments) && $content->module_settings->allowComments) { $content->comments = Comment::where('content_id', $content->id) + ->with('author') ->where('approved', 1) ->orderBy('created_at') ->get(); 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) +
+ @endif + + @if(isset($page->module_settings->allowComments) && $page->module_settings->allowComments != 0)