/** * Get wiki vertical * * @return string - wiki vertical */ protected function initCategories() { $name = ''; $categoryId = \WikiFactoryHub::getInstance()->getCategoryId($this->wg->CityId); if (!empty($categoryId)) { // get vertical id $verticalId = \HubService::getCanonicalCategoryId($categoryId); if (array_key_exists($verticalId, self::$pageCategories)) { $name = self::$pageCategories[$verticalId]; } } $this->categories = $name; }
protected function initVertical() { global $wgCityId; $this->verticalId = HubService::getCanonicalCategoryId(WikiFactory::getCategory($wgCityId)->cat_id); $this->cityId = $wgCityId; $this->verticalName = $this->getContext()->getTitle()->getText(); $this->canonicalVerticalName = str_replace(' ', '', $this->model->getCanonicalVerticalNameById($this->cityId)); $this->wg->out->setPageTitle($this->verticalName); // For the main page, overwrite the <title> element with the contents of 'pagetitle-view-mainpage'. if ($this->getContext()->getTitle()->isMainPage()) { $msg = wfMessage('pagetitle-view-mainpage')->inContentLanguage(); if (!$msg->isDisabled()) { $this->wg->out->setHTMLTitle($msg->title($this->getContext()->getTitle())); } } }