Update template from Derek
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 12 Aug 2014 14:59:14 +0000 (10:59 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 12 Aug 2014 14:59:14 +0000 (10:59 -0400)
Add in the GLMBlocks

Toolkit/Blocks/application.ini
Toolkit/Page.php
templates/template.html

index 3be385e..96e64f8 100644 (file)
@@ -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
index 9c1444e..af09afd 100755 (executable)
@@ -423,7 +423,6 @@ class Toolkit_Page
         $this->toolboxContent = $this->_toolboxPage->getBody(
             $this->_catid, $bodyFactory
         );
-//        echo '<pre>'.print_r($this->toolboxContent, true).'</pre>';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);
     }
index eabe50b..8826cab 100644 (file)
@@ -25,7 +25,7 @@
           <header class="row collapse">
             <div class="small-12 columns">
               <div class="logo left">
-                <a href="{homePageURL:h}"><img src="{mediaBaseURL:h}assets/logo.png" alt="Keweenaw Peninsula - Michigan's Copper Country" /></a>
+                <a href="{homePageUrl:h}"><img src="{mediaBaseURL:h}assets/logo.png" alt="Keweenaw Peninsula - Michigan's Copper Country" /></a>
               </div>
               <ul class="right global-nav">
                 <li><a href="{homePageUrl:h}">Home</a></li>
@@ -34,7 +34,7 @@
                 <li><a href="{getToolboxUrl(#19#):h}">Contact</a></li>
               </ul>
 
-              <form class="right search"  action="/" name="searchForm" method="get">
+              <form class="right search"  action="{homePageUrl:h}" name="searchForm" method="get">
                 <input type="hidden" name="GLMSearch" value="true">
                 <input type="hidden" name="start" value="0">
                 <input type="hidden" name="rows" value="10">
             <!-- /Nav Menus -->
 
             <!-- Header -->
+            {if:headlines[0]}
             <div class="row collapse header-content">
               <div class="small-12 medium-7 columns header-image">
-                <!--<img src="assets/mtn_biker.png" width="100%" />-->
+                  <div class="center-image">
+                   <img src="{headlines[0][img]:h}" />
+                 </div>
               </div>
               <div class="small-12 medium-5 columns content">
-                <h2>A World of Things to Do!</h2>
+                <h2>{headlines[0][header]}</h2>
                 <hr />
                 <p>
-                  Adventure through boreal forests long beaches of sands and magnificent rocks. Experience stunning sunrises and sunsets that will fill your eyes. See historic architecture, friendly villages and majestic panoramas. The wild is here, yet mixed with a culture of people who thrive in it.
+                    {headlines[0][descr]:h}
                 </p>
                 <div class="north"></div>
+                <img src="{mediaBaseURL:h}assets/blue_berries.png" />
               </div>
             </div>
+            {end:}
             {if:!isHomePage}
               {if:toolboxContent.breadCrumbs}
                 {toolboxContent.breadCrumbs:h}
             </div>
 
             <!-- Bottom -->
+            {if:headlines[1]}
             <div class="row  collapse bottom-content" flexy:if="isHomePage">
               <div class="small-12 medium-5 columns content">
-                <h2>A World of Things to See!</h2>
+                  <img src="{mediaBaseURL:h}assets/rasberries.png" />
+                <h2>{headlines[1][header]}</h2>
                 <hr />
                 <p>
-                  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}
                 </p>
                 <div class="north"></div>
               </div>
-              <div class="small-12 medium-7 columns bottom-image"></div>
+              <div class="small-12 medium-7 columns bottom-image">
+                 <div class="center-image">
+                   <img src="{headlines[1][img]}" />
+                 </div>
+               </div>
             </div>
+            {end:}
 
             <!-- Footer -->
             <footer class="row collapse">