diff --git a/components/com_tags/views/tag/view.html.php b/components/com_tags/views/tag/view.html.php index 6107ec7e83178..4d8e44f847878 100644 --- a/components/com_tags/views/tag/view.html.php +++ b/components/com_tags/views/tag/view.html.php @@ -208,26 +208,26 @@ public function display($tpl = null) */ protected function _prepareDocument() { - $app = JFactory::getApplication(); - $menus = $app->getMenu(); - $title = null; - - // Generate the tags title to use for page title, page heading and show tags title option + $app = JFactory::getApplication(); + $menu = $app->getMenu()->getActive(); $this->tags_title = $this->getTagsTitle(); + $title = ''; - // Because the application sets a default page title, - // we need to get it from the menu item itself - $menu = $menus->getActive(); + // Highest priority for "Browser Page Title". + if ($menu) + { + $title = $menu->params->get('page_title', ''); + } if ($this->tags_title) { $this->params->def('page_heading', $this->tags_title); - $title = $this->tags_title; + $title = $title ?: $this->tags_title; } elseif ($menu) { $this->params->def('page_heading', $this->params->get('page_title', $menu->title)); - $title = $this->params->get('page_title', $menu->title); + $title = $title ?: $this->params->get('page_title', $menu->title); if ($menu->query['option'] !== 'com_tags') {