diff --git a/app/Http/Controllers/Theming/ThemeController.php b/app/Http/Controllers/Theming/ThemeController.php index 26cbdf2..9aea678 100644 --- a/app/Http/Controllers/Theming/ThemeController.php +++ b/app/Http/Controllers/Theming/ThemeController.php @@ -94,18 +94,30 @@ class ThemeController extends Controller } } - public function getView($view) + public function getView($view = 'index') { + $template = 'fipamo-default-v2.index'; + switch ($view) { + case "page": + $template = 'fipamo-default-v2.page'; + break; + } if ($this->auth::status()) { - $page = $this->pages->getById('09E5A362-BA31-4AE2-9DEE-C93DFBE005C3')->first(); - $options = $this->sort->page($page); - return view('fipamo-default-v2.base', [ - "debug" => "true", - "theme" => 'fipamo-default-v2', - "status" => $this->auth::status(), - "title" => "THEME PAGE", - "page" => $page, - "info" => $options['info'], + $page = $this->pages->getById('58E3D3DA-E7E4-4396-B4E5-0C30781C2F19')->first(); + $data = $this->sort->page($page); + return view($template, [ + "debug" => "true", + "theme" => 'fipamo-default-v2', + "status" => $this->auth::status(), + "title" => "THEME PAGE", + "menu" => $data['menu'], + "page" => $page, + "info" => $data['info'], + "media" => $data['media'], + "content" => $data['content'], + "recent" => $data['recent'], + "feature" => $data['featured'], + "dynamicRender" => $data['dynamicRender'], ]); } else { return redirect('dashboard/start'); diff --git a/app/Services/SortingService.php b/app/Services/SortingService.php index 5ca31b2..28d5aae 100644 --- a/app/Services/SortingService.php +++ b/app/Services/SortingService.php @@ -163,7 +163,7 @@ class SortingService } } } - + //TODO: get rid of if statement and always return recent and featured if ($page['layout'] == 'index') { $recent = []; $featured = []; @@ -223,7 +223,6 @@ class SortingService 'files' => $page['docs'], ]; } - //var_dump($pageOptions); return $pageOptions; } } diff --git a/content/themes/fipamo-default-v2/base.blade.php b/content/themes/fipamo-default-v2/base.blade.php index 1caa6f8..86cf27e 100644 --- a/content/themes/fipamo-default-v2/base.blade.php +++ b/content/themes/fipamo-default-v2/base.blade.php @@ -41,18 +41,18 @@ @endif @endforeach @else - @if($page['media'] != '') - @if($page['media']['type'] == "mp4") + @if($media != '') + @if($media[0]['type'] == "mp4")