We can create a layout file on the frontend using the block or pages from magetno admin panel
here the trick used to create that.
all phtml using block code
login to magento admin. Open any cms page and write block code in content section.
{{block class="Magento\Framework\View\Element\Template" template="JJ_Account::e_catalog.phtml"}}
Here we called an external phtml file to a page on the admin pages builder.
and this can be viewed on the frontend with php condition on the corresponding page.
If you want to call phtml file on all cms pages then you can create a layout file to achieve this.
create layout “cms_page_view.xml” file in your module.
Put the following code in layout file.