Homepage text title now taken from toolbox
authorLaury GvR <laury@gaslightmedia.com>
Thu, 4 Sep 2014 13:36:35 +0000 (09:36 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Thu, 4 Sep 2014 13:36:35 +0000 (09:36 -0400)
Using pageTitleShort instead of pageTitle.
The jquery addition is an attempt to override tripadvisor stubbornness.

Toolkit/Page.php
templates/template.html

index f8e3a52..4478769 100755 (executable)
@@ -84,6 +84,7 @@ class Toolkit_Page
      * @access public
      */
     public $pageTitle;
+    public $pageTitleShort;
 
     /**
      * The main content of website
@@ -416,7 +417,8 @@ class Toolkit_Page
             }
         }
         $this->pageTitle = $this->_getPageTitle($this->_catid);
-
+        $this->pageTitleShort = $this->_getPageTitleShort($this->_catid);
+        
         $bodyFactory = new Toolkit_Template_Page_BodyFactory(
             $this->_breadCrumbs,
             $this->_pageGateway,
@@ -751,6 +753,39 @@ class Toolkit_Page
 
         return $title;
     }
+    
+        /**
+     * Returns page title
+     *
+     * @param type $id page id
+     *
+     * @return string
+     */
+    private function _getPageTitleShort($id)
+    {
+        if (filter_input(INPUT_GET, 'member_id', FILTER_VALIDATE_INT)) {
+            // Member profile pages can't have search page title tags
+            return SITENAME;
+        }
+
+        $page = $this->_pageGateway->find($id);
+
+        if (!empty($page['meta_title'])) {
+            $title = $page['meta_title'];
+        } elseif (!empty($page['title'])) {
+            $title = $page['title'];
+        } elseif (!empty($page['navigation_name'])) {
+            $title = $page['navigation_name'];
+        }
+
+        $title = strip_tags($title);
+
+        $title = isset($title)
+            ? htmlentities("$title", ENT_QUOTES, 'UTF-8')
+            : SITENAME;
+
+        return $title;
+    }
 
     /**
      * Returns side navigation
index 4a33b07..cfe9b60 100644 (file)
             </div>
             <div class="row" flexy:if="isHomePage">
               <h2 class="small-12 columns text-center">
-                ~ Hospitality, Quality &amp; Comfort at Budget Rates ~
+                {pageTitleShort:h}
               </h2>
             </div>
             <!-- Content Areas -->
         $('.datepicker').datepicker();
         $('#toolbox .listing ul li').attr('class','small-12 large-6 columns');
         $('#toolbox .listing ul').attr('class','listul');
+        $('.TA_certificateOfExcellence a').attr('href','http://www.tripadvisor.com/Hotel_Review-g42671-d585135-Reviews-Budget_Host_Inn_Suites-Saint_Ignace_Mackinac_County_Upper_Peninsula_Michigan.html');
       });
     </script>
   </body>