From dc22c3e71fd23d391c88db34180a6aa3db932981 Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Thu, 4 Sep 2014 09:36:35 -0400 Subject: [PATCH] Homepage text title now taken from toolbox Using pageTitleShort instead of pageTitle. The jquery addition is an attempt to override tripadvisor stubbornness. --- Toolkit/Page.php | 37 ++++++++++++++++++++++++++++++++++++- templates/template.html | 3 ++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/Toolkit/Page.php b/Toolkit/Page.php index f8e3a52..4478769 100755 --- a/Toolkit/Page.php +++ b/Toolkit/Page.php @@ -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 diff --git a/templates/template.html b/templates/template.html index 4a33b07..cfe9b60 100644 --- a/templates/template.html +++ b/templates/template.html @@ -150,7 +150,7 @@

- ~ Hospitality, Quality & Comfort at Budget Rates ~ + {pageTitleShort:h}

@@ -272,6 +272,7 @@ $('.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'); }); -- 2.17.1