I've encountered a scenario where the menu item Title specified on the Joomla back-end in Menu Manager overrides the following call: JFactory::getDocument()->setTitle('Custom title')
The document's title becomes 'Custom title' up until the following lines in components/com_content/views/article/view.html.php
:
if (empty($title)) {
$title = $this->item->title;
}
$this->document->setTitle($title);
I assign a new title to the document in my module:
JFactory::getDocument()->setTitle('New title');
How can I stop Joomla from overwriting the article I gave the document in my module?