[更新] 文章详情左侧加分类
This commit is contained in:
@@ -11,8 +11,8 @@ class ArticleController extends Controller
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 显示分类
|
* 显示分类
|
||||||
* @param Category $category [description]
|
* @param \App\Models\Article $article
|
||||||
* @return [type] [description]
|
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View [type] [description]
|
||||||
*/
|
*/
|
||||||
public function show(Article $article)
|
public function show(Article $article)
|
||||||
{
|
{
|
||||||
@@ -24,7 +24,7 @@ class ArticleController extends Controller
|
|||||||
->where('status', 1)
|
->where('status', 1)
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
return view('article.show', compact('article', 'next', 'parent'));
|
return view('article.show', compact('article', 'next', 'parent', 'category'));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,26 @@
|
|||||||
@section('title', '文章详情')
|
@section('title', '文章详情')
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
|
|
||||||
|
<div class="container child">
|
||||||
|
<!-- 侧边导航 -->
|
||||||
|
<div class="child-nav">
|
||||||
|
<div class="kj-bjt" style="text-align: center;">
|
||||||
|
<b>{{ $category->title }}</b>
|
||||||
|
<p>{{ $category->description }}</p>
|
||||||
|
</div>
|
||||||
|
<ul class="child-nav-ul">
|
||||||
|
@if ($parent->childrens->isNotEmpty())
|
||||||
|
@foreach ($parent->childrens as $child)
|
||||||
|
<li>
|
||||||
|
<a href="{{ $child->link }}" @if($category->id==$child->id) class="show" @endif>{{ $child->title }}</a>
|
||||||
|
</li>
|
||||||
|
@endforeach
|
||||||
|
@endif
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<!-- content -->
|
||||||
|
<div class="child-content">
|
||||||
<!-- mian -->
|
<!-- mian -->
|
||||||
<div class="container child">
|
<div class="container child">
|
||||||
<div class="wzxq">
|
<div class="wzxq">
|
||||||
@@ -25,4 +45,9 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!-- end mian -->
|
<!-- end mian -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
Reference in New Issue
Block a user