Solved it. The problem was that I had a layout using Magento\Customer\Block\Form\Login
, like this:
<block class="Magento\Customer\Block\Form\Login" name="login.sidebar" template="form/login_sidebar.phtml">
<container name="form.additional.info" as="form_additional_info"/>
</block>
I saw that Magento\Customer\Block\Form\Login
class was overriding _prepareLayout()
function like this:
/**
* @return $this
*/
protected function _prepareLayout()
{
$this->pageConfig->getTitle()->set(__('Customer Login'));
return parent::_prepareLayout();
}
So I created a custom Block in app/code/MyVendor/MyModule/Block/Form/Login
extending Magento\Customer\Block\Form\Login
and overriding _prepareLayout()
function like this:
<?php
namespace MyVendor\MyModule\Block\Form;
use Magento\Customer\Block\Form\Login as BaseLogin;
class Login extends BaseLogin
{
/**
* @return $this
*/
protected function _prepareLayout()
{
return $this;
}
}
And then I replaced in my custom layout this:
<block class="Magento\Customer\Block\Form\Login" name="login.sidebar" template="form/login_sidebar.phtml">
<container name="form.additional.info" as="form_additional_info"/>
</block>
by that:
<block class="MyVendor\MyModule\Block\Form\Login" name="login.sidebar" template="Magento_Customer::form/login_sidebar.phtml">
<container name="form.additional.info" as="form_additional_info"/>
</block>
And the issue was solved!
Contact page and Advanced Search page
titles? – mageDev0688 Jun 29 '17 at 9:48<referenceBlock name="page.main.title"> <action method="setPageTitle"> <argument translate="true" name="title" xsi:type="string">BLAH BLAH</argument> </action> </referenceBlock>
in contact_index_index.xml but it didn't work. – Thomas Domingues Jun 29 '17 at 9:49contact_index_index.xml
this should be in/app/design/frontend/Vendor/ThemeName/Magento_Contact/layout
. – mageDev0688 Jun 29 '17 at 10:00