/** * Prepare document. * * @return void */ protected function prepareDocument() { $page = $this->pagination->pagesCurrent; $pages = $this->pagination->pagesTotal; $pagesText = $page > 1 ? " ({$page}/{$pages})" : ''; $parentText = $this->category->getParent()->displayField('name'); $categoryText = $this->category->displayField('name'); $app = JFactory::getApplication(); $menu_item = $app->getMenu()->getActive(); // get the active item if ($menu_item) { $params = $menu_item->params; // get the params $params_title = $params->get('page_title'); $params_keywords = $params->get('menu-meta_keywords'); $params_description = $params->get('menu-meta_description'); if (!empty($params_title)) { $title = $params->get('page_title'); $this->setTitle($title); } else { $title = JText::sprintf('COM_KUNENA_VIEW_CATEGORY_DEFAULT', "{$parentText} / {$categoryText}{$pagesText}"); $this->setTitle($title); } if (!empty($params_keywords)) { $keywords = $params->get('menu-meta_keywords'); $this->setKeywords($keywords); } else { $keywords = JText::_('COM_KUNENA_CATEGORIES') . ", {$parentText}, {$categoryText}, {$this->config->board_title}"; $this->setKeywords($keywords); } if (!empty($params_description)) { $description = $params->get('menu-meta_description'); $this->setDescription($description); } else { $description = "{$parentText} - {$categoryText}{$pagesText} - {$this->config->board_title}"; $this->setDescription($description); } } }
/** * Prepare document. * * @return void */ protected function prepareDocument() { $page = $this->pagination->pagesCurrent; $pages = $this->pagination->pagesTotal; $pagesText = $page > 1 ? " ({$page}/{$pages})" : ''; $parentText = $this->category->getParent()->displayField('name'); $categoryText = $this->category->displayField('name'); $title = JText::sprintf('COM_KUNENA_VIEW_CATEGORY_DEFAULT', "{$parentText} / {$categoryText}{$pagesText}"); $this->setTitle($title); $keywords = JText::_('COM_KUNENA_CATEGORIES') . ", {$parentText}, {$categoryText}, {$this->config->board_title}"; $this->setKeywords($keywords); $description = "{$parentText} - {$categoryText}{$pagesText} - {$this->config->board_title}"; $this->setDescription($description); }