Setup 41 as the default page block
authorSteve Sutton <steve@gaslightmedia.com>
Mon, 18 Aug 2014 12:55:55 +0000 (08:55 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Mon, 18 Aug 2014 12:55:55 +0000 (08:55 -0400)
For site-map and members only pages need default page for the blocks.
using page 41 (about us)

Toolkit/Page.php
Toolkit/Template/Page/SiteMap.php
setup.phtml

index 68844eb..f0f31bb 100755 (executable)
@@ -544,8 +544,6 @@ class Toolkit_Page
 
         if (   defined("GLM_BLOCKS")
             && GLM_BLOCKS
-            && !filter_var($_REQUEST[ 'sitemap'], FILTER_VALIDATE_INT)
-            && !isset($_REQUEST['query'])
         ) {
             $this->_getBlocks($this->topParentId);
         }
@@ -903,8 +901,12 @@ class Toolkit_Page
      */
     private function _getBlocks($parentId)
     {
-        if ($this->_catid == HOME_ID) {
+        if ($this->_catid == HOME_ID && $this->isHomePage) {
             $parentId = HOME_ID;
+        } else if (!$this->isHomePage
+            && in_array($this->_catid, array(HOME_ID, MEMBERS_CATEGORY))
+        ) {
+            $parentId = DEFAULT_PAGE_BLOCK;
         }
         $cache = new Cache_Lite($GLOBALS['cacheOptions']);
         if ($blockContent = $cache->get($parentId, 'Block')) {
index 392bd66..1fa4318 100644 (file)
@@ -77,15 +77,14 @@ class Toolkit_Template_Page_SiteMap
     {
         $GLOBALS['styleSheets'][] = MEDIA_BASE_URL . 'css/siteMap.css';
         $navArray = $this->getNavArray(0);
-        $tPage     = new stdClass();
+        $tPage    = new stdClass();
         $tpl      = new HTML_Template_Flexy(
             $GLOBALS['flexyOptions']
         );
         $tPage->nav = $navArray;
-//        echo '<pre>'.print_r($tPage, true).'</pre>';exit;
-//        $tpl->compile('siteMap.html');
+        //echo '<pre>'.print_r($tPage, true).'</pre>';exit;
+        //$tpl->compile('siteMap.html');
         return $tPage;
-//        return $tpl->bufferedOutputObject($page);
     }
 
     //    }}}
index ce3c42a..97da28e 100644 (file)
@@ -54,6 +54,7 @@ if (!isset($DEBUG)) {
 }
 $securePagesArray = array();
 define('SECURE_PAGES', serialize($securePagesArray));
+define('DEFAULT_PAGE_BLOCK', 41);
 $mainNavigationUl = array(
     'activities'  => 2,
     'attractions' => 7,