How I can call a phtml file in Magento CMS page

You can not call a phtml file by writing PHP code in Magento admin panel as Magento admin panel do not support this. To enable PHTML/ PHP code you can write a file called PHTML file by doing the following method

{{ block type="core/template" name="mycstompage" template="SkyMagento/mycustompage.phtml" }}

inside template = "" allows you to write your path. and in the name = "", you can give a good and unique name type = "", you can also write your module directory (for example: - the client / account if you call login.phtml file).

Another way to call a phtml file. You can use the layout or xml file to do so. I'm going mycstompage.phtml attached file that reside in the folder of my mycustompage  template inside SkyMagento folder then I write the code given below

<Reference name="content">
 <Block type="core/template" name="mycustompage"  template="SkyMagento/mycustompage.phtml" />
 </ Reference >

2026 update: prefer supported content and layout mechanisms

Older Magento examples often embedded template output directly from CMS content. On current Magento 2 and Adobe Commerce installations, start with supported content blocks, widgets, Page Builder where available, layout XML and module/view-model patterns. The right choice depends on whether the content is editorial, reusable, dynamic or application logic.

What to verify before acting

Avoid treating CMS content as a place to execute arbitrary PHP. Keep business logic out of templates, escape dynamic output appropriately and review Content Security Policy implications when custom frontend behavior introduces scripts or external resources. Adobe Commerce 2.4.7 and later applies stricter CSP behavior on payment pages, so legacy inline patterns deserve particular scrutiny.

  • Use CMS blocks or Page Builder for managed content.
  • Use widgets or layout XML when content needs controlled placement.
  • Keep application logic in modules/services rather than PHTML templates.
  • Test custom frontend output against CSP and the active theme before release.

Platform reference: Adobe Commerce Content and Design Guide.

Substantive content review: 14 October 2026.