I just started working on magento 2 and i want to call a phtml file for every cms page. I have created a theme and under Magento_Cms i have copied cms_page_view.xml from vendor and placed it in there.Now i added below code there.
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="content">
<block class="Magento\Cms\Block\Page" name="cms_page"/>
</referenceContainer>
<referenceContainer name="maincontent">
<block class="Magento\Cms\Block\Page" name="custom.page.title" before="-" template="Magento_Cms::page/title.phtml"/>
</referenceContainer>
</body>
</page>
page/title.phtml placed inside Magento_Cms/templates/page/title.phtml and i used die there.. and after flushing cache my phtml is not getting call. I am not able to see die effect on page. Please suggest me how can i render custom phtml file for all cms pages using xml