/**
* Prepares the document
*
* @return void
*
* @since 3.2
*/
protected function prepareDocument()
{
// Because the application sets a default page title, we need to get it from the menu item itself
$menu = Factory::getApplication()->getMenu()->getActive();
if ($menu) {
$this->params->def('page_heading', $this->params->get('page_title', $menu->title));
} else {
$this->params->def('page_heading', Text::_($this->pageHeading));
}
$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'));
}
}