I'm struggling with something simple.
I'm trying to print the Page Title in the custom block from my custom.phtml and I'm getting nothing.
I've removed the Magento original page title block from all pages by updating default.xml
referenceBlock name="page.main.title" remove="true"
I've created my own block and pointed it to my phtml file in the same default.xml
block class="Magento\Framework\View\Element\Template" name="page_title" template="Magento_Theme::page_title.phtml"
Now the problem is even if i copy paste the contents of original /module-theme/view/frontend/templates/html/title.phtml
into my custom page_title.phtml I'm getting nothing, 0. It's not the case of caching or anything similar as any other type of content gets displayed no problem. :(
All I'm looking for is a way to access that $titleHtml variable from title.phtml somehow... Any help? :(