diff --git a/app/Http/Controllers/RouteController.php b/app/Http/Controllers/RouteController.php
index 23b26f9..71f92a4 100644
--- a/app/Http/Controllers/RouteController.php
+++ b/app/Http/Controllers/RouteController.php
@@ -41,7 +41,7 @@ class RouteController extends Controller
case 'theme':
if ($this->member::status()) {
if (isset($second)) {
- return $this->theme->getView($third);
+ return $this->theme->getView($third, $fourth);
} else {
return $this->theme->start();
}
diff --git a/app/Http/Controllers/ThemeController.php b/app/Http/Controllers/ThemeController.php
index 96743af..18edc37 100644
--- a/app/Http/Controllers/ThemeController.php
+++ b/app/Http/Controllers/ThemeController.php
@@ -43,7 +43,7 @@ class ThemeController extends Controller
}
}
- public function getView($view = 'index')
+ public function getView($view = 'index', $id = null)
{
//move assets to theme testing dir
$this->assets->moveToTheme();
@@ -53,11 +53,18 @@ class ThemeController extends Controller
switch ($view) {
case "index":
case "page":
- $view == 'index' ?
- $template = $currentTheme . '.index' :
+ $page;
+ if ($view == 'index') {
+ $template = $currentTheme . '.index';
+ $page = $this->pages->getBySlug('first');
+ } else {
$template = $currentTheme . '.page';
- //TODO: Get rid of hard link page IDS
- $page = $this->pages->getById('F791DED9-0359-4662-8976-4C474803D2C6');
+ //if coming from theme page, grabs id of latest page
+ if ($id == null) {
+ $id = $this->getPageID();
+ }
+ $page = $this->pages->getById($id);
+ }
$pageData = $this->sort->page($page);
break;
case "tags":
@@ -71,7 +78,7 @@ class ThemeController extends Controller
break;
default:
$template = $currentTheme . '.index';
- $page = $this->pages->getById('26245BDB-1A38-4455-80A2-7A03DE26EE33');
+ $page = $this->pages->getBySlug('first');
$pageData = $this->sort->page($page);
}
if ($this->member::status()) {
@@ -80,4 +87,11 @@ class ThemeController extends Controller
return redirect('dashboard/start');
}
}
+
+ private function getPageID()
+ {
+ $book = $this->pages->getAll();
+ $page = $book->where('layout', 'page')->first();
+ return $page['uuid'];
+ }
}
diff --git a/resources/views/includes/options.blade.php b/resources/views/includes/options.blade.php
index 3244e5b..c8844a4 100644
--- a/resources/views/includes/options.blade.php
+++ b/resources/views/includes/options.blade.php
@@ -44,7 +44,7 @@ if(isset($page['uuid']))
-