Some of the pages show incorrect title and heading : it is showing "Customer Login" as page heading and title for Contact page and Advanced Search page.
The point is, I included customer login form on every page including these above, but anywhere else I can edit the page title successfully…
How to edit these pages title and heading ?
Best Answer
Solved it. The problem was that I had a layout using
Magento\Customer\Block\Form\Login
, like this:I saw that
Magento\Customer\Block\Form\Login
class was overriding_prepareLayout()
function like this:So I created a custom Block in
app/code/MyVendor/MyModule/Block/Form/Login
extendingMagento\Customer\Block\Form\Login
and overriding_prepareLayout()
function like this:And then I replaced in my custom layout this:
by that:
And the issue was solved!