I noticed that you can set the page title in the layout xml per how to modify page title.

but it's not working in the admin - if I want to change the admin page title, in the Controller, this works:

$resultPage->getConfig()->getTitle()->prepend(__('Customers Now Online'));

Is there a way to set the result content page title in the layout xml?


Add this in Block file which is associated to phtml file.

 public function getHeader()
            if ($this->getProduct()->getId()) {
                $header = $this->escapeHtml($this->getProduct()->getName());
            } else {
                $header = __('New Product');
            return $header;

Change this function as your requirement. Also header need to declare into xml file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.