Skip to content

Commit

Permalink
page main_content partial
Browse files Browse the repository at this point in the history
  • Loading branch information
sdebacker committed Sep 12, 2022
1 parent a1afaf4 commit 3d21e72
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
23 changes: 23 additions & 0 deletions resources/views/pages/public/_main-content.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
@empty(!$page->image)
<div class="page-row">
<div class="page-left">
<h1 class="page-title">{!! nl2br($page->title) !!}</h1>
@empty($page->body)
<div class="rich-content">{!! $page->present()->body !!}</div>
@endempty
</div>
<div class="page-right">
<figure class="page-figure">
<img class="page-figure-image mb-5" src="{{ $page->present()->image(2400) }}" width="{{ $page->image->width }}" height="{{ $page->image->height }}" alt="{{ $page->image->alt_attribute }}">
@empty(!$page->image->description)
<figcaption class="page-figure-caption">{{ $page->image->description }}</figcaption>
@endempty
</figure>
</div>
</div>
@else
<h1 class="page-title">{!! nl2br($page->title) !!}</h1>
@empty(!$page->body)
<div class="rich-content">{!! $page->present()->body !!}</div>
@endempty
@endempty
10 changes: 1 addition & 9 deletions resources/views/pages/public/default.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,7 @@
<div class="page-body-container">

@include('pages::public._subpages')

@empty(!$page->image)
<img class="page-image" src="{{ $page->present()->image(2000) }}" width="{{ $page->image->width }}" height="{{ $page->image->height }}" alt="">
@endempty

@empty(!$page->body)
<div class="rich-content">{!! $page->present()->body !!}</div>
@endempty

@include('pages::public._main-content', ['page' => $page])
@include('files::public._documents', ['model' => $page])
@include('files::public._images', ['model' => $page])

Expand Down

0 comments on commit 3d21e72

Please sign in to comment.