protected function _loadPageStatus()
    {
        $lowestLevelPage = count($this->pageLevels) > 0 ? end($this->pageLevels) : null;

        if ($lowestLevelPage) {

            /** @var Page $lowestLevelPage */
            $this->isLive = $lowestLevelPage->is_live();

            if (!$this->is404) {
                if ($previewKey = Request::input('preview')) {
                    $this->previewVersion = PageVersion::where('page_id', '=', $lowestLevelPage->id)->where('preview_key', '=', $previewKey)->first() ?: null;
                }
            }

        }

        if($customTemplate = Request::get('external')) {
            $this->customTemplate = 'externals.' . $customTemplate;
        }

    }
protected function _loadPageStatus()
    {
        $lowestLevelPage = count($this->pageLevels) > 0 ? end($this->pageLevels) : null;

        if ($lowestLevelPage) {

            /** @var Page $lowestLevelPage */
            $this->isLive = $lowestLevelPage->is_live();

            if (!$this->is404) {
                if ($previewKey = Request::input('preview')) {
                    $this->previewVersion = PageVersion::where('page_id', '=', $lowestLevelPage->id)->where('preview_key', '=', $previewKey)->first() ?: null;
                }
            }

        }

        if($customTemplate = Request::get('external')) {
            $this->customTemplate = 'externals.' . $customTemplate;
        }

    }
protected function _loadPageStatus ( ) { $ lowestLevelPage = count ( $ this -> pageLevels ) > 0 ? end ( $ this -> pageLevels ) : null ; if ( $ lowestLevelPage ) { /** @var Page $lowestLevelPage */ $ this -> isLive = $ lowestLevelPage -> is_live ( ) ; if ( ! $ this -> is404 ) { if ( $ previewKey = Request :: input ( 'preview' ) ) { $ this -> previewVersion = PageVersion :: where ( 'page_id' , '=' , $ lowestLevelPage -> id ) -> where ( 'preview_key' , '=' , $ previewKey ) -> first ( ) ? : null ; } } } if ( $ customTemplate = Request :: get ( 'external' ) ) { $ this -> customTemplate = 'externals.' . $ customTemplate ; } }
Load current page status.
Is live, Is preview, Custom Template
Load current page status . Is live Is preview Custom Template