/**
* Method to prepares the document
*
* @return void
*
* @since 3.2
*/
protected function prepareDocument()
{
$app = Factory::getApplication();
$this->pathway = $app->getPathway();
// Because the application sets a default page title, we need to get it from the menu item itself
$this->menu = $app->getMenu()->getActive();
if ($this->menu) {
$this->params->def('page_heading', $this->params->get('page_title', $this->menu->title));
} else {
$this->params->def('page_heading', Text::_($this->defaultPageTitle));
}
$this->setDocumentTitle($this->params->get('page_title', ''));
if ($this->params->get('menu-meta_description')) {
$this->document->setDescription($this->params->get('menu-meta_description'));
}
if ($this->params->get('robots')) {
$this->document->setMetaData('robots', $this->params->get('robots'));
}
}