diff --git a/module/VuFind/src/VuFind/Bootstrap.php b/module/VuFind/src/VuFind/Bootstrap.php index 883f81b1da796640f51438397b8518013eee166e..1fa410d55adf844f1b9c7f33cb573785fd1079e3 100644 --- a/module/VuFind/src/VuFind/Bootstrap.php +++ b/module/VuFind/src/VuFind/Bootstrap.php @@ -66,6 +66,7 @@ class Bootstrap { $this->initAccount(); $this->initContext(); + $this->initHeadTitle(); $this->initTheme(); } @@ -107,6 +108,24 @@ class Bootstrap $this->events->attach('dispatch', $callback); } + /** + * Set up headTitle view helper -- we always want to set, not append, titles. + * + * @return void + */ + protected function initHeadTitle() + { + $callback = function($event) { + $serviceManager = $event->getApplication()->getServiceManager(); + $renderer = $serviceManager->get('viewmanager')->getRenderer(); + $headTitle = $renderer->plugin('headtitle'); + $headTitle->setDefaultAttachOrder( + \Zend\View\Helper\Placeholder\Container\AbstractContainer::SET + ); + }; + $this->events->attach('dispatch', $callback); + } + /** * Set up theme handling. * diff --git a/themes/vufind/blueprint/templates/author/results.phtml b/themes/vufind/blueprint/templates/author/results.phtml index 0f4d16eacc81e870413405956135efbff7b121a7..76f90ba9081fcdc838fc932e9103eb5898332b94 100644 --- a/themes/vufind/blueprint/templates/author/results.phtml +++ b/themes/vufind/blueprint/templates/author/results.phtml @@ -5,10 +5,7 @@ // Override some details... // Set up page title: - $this->headTitle( - $this->translate('Author Search Results'), - Zend_View_Helper_Placeholder_Container_Abstract::SET - ); + $this->headTitle($this->translate('Author Search Results')); // Set up empty search box: $this->layout()->searchbox = $this->render('search/searchbox.phtml'); diff --git a/themes/vufind/blueprint/templates/author/search.phtml b/themes/vufind/blueprint/templates/author/search.phtml index f8fc1bf0fa72feaabd3431fba8bb8ac4e393d629..c01aedc492bb45847e6fc09c58bcca43ba2b8ae4 100644 --- a/themes/vufind/blueprint/templates/author/search.phtml +++ b/themes/vufind/blueprint/templates/author/search.phtml @@ -13,10 +13,7 @@ // Override some details... // Set up page title: - $this->headTitle( - $this->translate('Author Browse'), - Zend_View_Helper_Placeholder_Container_Abstract::SET - ); + $this->headTitle($this->translate('Author Browse')); // Set up empty search box: $this->layout()->searchbox = $this->render('search/searchbox.phtml'); diff --git a/themes/vufind/jquerymobile/templates/author/results.phtml b/themes/vufind/jquerymobile/templates/author/results.phtml index d1a1cae242ad377078df3397cefe5a6548e36e5e..ced264acc6d1c326d7d61b509890bbb525a60b8a 100644 --- a/themes/vufind/jquerymobile/templates/author/results.phtml +++ b/themes/vufind/jquerymobile/templates/author/results.phtml @@ -5,8 +5,5 @@ // Override some details... // Set up page title: - $this->headTitle( - $this->translate('Author Search Results'), - Zend_View_Helper_Placeholder_Container_Abstract::SET - ); + $this->headTitle($this->translate('Author Search Results')); ?> \ No newline at end of file diff --git a/themes/vufind/jquerymobile/templates/author/search.phtml b/themes/vufind/jquerymobile/templates/author/search.phtml index efa29c774c19a5ceff82a6a614cf2c4f8f6764e0..30dd8161fc38f90331736785794e1611f7391d0b 100644 --- a/themes/vufind/jquerymobile/templates/author/search.phtml +++ b/themes/vufind/jquerymobile/templates/author/search.phtml @@ -10,8 +10,5 @@ // Override some details... // Set up page title: - $this->headTitle( - $this->translate('Author Browse'), - Zend_View_Helper_Placeholder_Container_Abstract::SET - ); + $this->headTitle($this->translate('Author Browse')); ?> \ No newline at end of file