From fbfb8168d2cff117345229ff32c0fb2ed0d46384 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Tue, 12 Aug 2014 10:59:14 -0400 Subject: [PATCH] Update template from Derek Add in the GLMBlocks --- Toolkit/Blocks/application.ini | 2 +- Toolkit/Page.php | 14 ++++++++------ templates/template.html | 28 ++++++++++++++++++++-------- 3 files changed, 29 insertions(+), 15 deletions(-) diff --git a/Toolkit/Blocks/application.ini b/Toolkit/Blocks/application.ini index 3be385e..96e64f8 100644 --- a/Toolkit/Blocks/application.ini +++ b/Toolkit/Blocks/application.ini @@ -19,7 +19,7 @@ jqueryui.version = "1.8.13" ; jQuery themes {"base", "cupertino", "smoothness", "start"} jqueryui.theme = "base" -canCreateOnAnyPage = Off +canCreateOnAnyPage = On ; development server configuration data inherits from production and ; overrides values as necessary diff --git a/Toolkit/Page.php b/Toolkit/Page.php index 9c1444e..af09afd 100755 --- a/Toolkit/Page.php +++ b/Toolkit/Page.php @@ -423,7 +423,6 @@ class Toolkit_Page $this->toolboxContent = $this->_toolboxPage->getBody( $this->_catid, $bodyFactory ); -// echo '
'.print_r($this->toolboxContent, true).'
';exit; $page = $this->_pageGateway->find($this->_catid); $this->topParentId = $this->_pageGateway->findTopParent($this->_catid); @@ -513,7 +512,7 @@ class Toolkit_Page && !filter_var($_REQUEST[ 'sitemap'], FILTER_VALIDATE_INT) && !isset($_REQUEST['query']) ) { - $this->_getBlocks(); + $this->_getBlocks($this->topParentId); } if ( defined("PRESS_DB") @@ -754,18 +753,21 @@ class Toolkit_Page * @return void * @access private */ - private function _getBlocks() + private function _getBlocks($parentId) { + if ($this->_catid == HOME_ID) { + $parentId = HOME_ID; + } $cache = new Cache_Lite($GLOBALS['cacheOptions']); - if ($blockContent = $cache->get($this->_catid, 'Block')) { + if ($blockContent = $cache->get($parentId, 'Block')) { $this->headlines = unserialize($blockContent); } else { $blocks = new Toolkit_Blocks_Display( Toolkit_Database::getInstance() ); $this->headlines - = $blocks->getPageBlocksAsArray((int)$this->_catid); - $cache->save(serialize($this->headlines), $this->_catid, 'Block'); + = $blocks->getPageBlocksAsArray((int)$parentId); + $cache->save(serialize($this->headlines), $parentId, 'Block'); } $this->hasHeadlines = !empty($this->headlines); } diff --git a/templates/template.html b/templates/template.html index eabe50b..8826cab 100644 --- a/templates/template.html +++ b/templates/template.html @@ -25,7 +25,7 @@
-
+ {if:headlines[1]}
-

A World of Things to See!

+ +

{headlines[1][header]}


- Seek your extreme adventure right here! Epic hikes and biking. Snowfall, ski hills and snowmobile and water trails everywhere. Lake Superior cliffs, mines and caves all waiting to be discovered and visit the hundreds of freshwater shipwrecks. + {headlines[1][descr]:h}

-
+
+
+ +
+
+ {end:}