/**
  * @param $page
  */
 private function setViewVariables($page)
 {
     View::share('page', $page);
     View::share('title', $page->content->title);
     //only allow page edit in a page with a page_id
     View::share('allow_edit_page', $page->id ? true : false);
     //Breadcrumbs
     View::share('breadcrumbs', \Cms\Models\Page::subPages($page->id));
 }
Example #2
0
 /**
  * Get the top parent page ID of the current page
  */
 public function getTopParent()
 {
     $subpages = Page::subPages($this->page_id);
     if ($subpages) {
         $topPage = $subpages['0'];
         return $topPage['page_id'];
     }
 }