Magento 2
Add a Template Block to a Page
Free Preview
<!-- A standard PHTML template that contains the info you wish to display. -->
<p><?= __('This is a description') ?></p>
<?xml version="1.0"?>
The file cms_index_index.xml targets {routeId}_{controllerName}_{actionName}.
In this case, the routeId is "cms" and will target the index controller and
action. This will make this layout XML file only apply to the home page.
<page xmlns:xsi="" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        Create a "referenceContainer" node, using the name of the container or
        block you wish to place your template within.
        <referenceContainer name="content">
            Create a new "block" child node. The "name" is any arbitrary name,
            usually delineated with periods or underscores. The "template"
            attribute expects the string syntax of a module, in the format
            The location after the double colons resolves to
            view/frontend/templates of the main module directory. For example,
            the following code resolves to look for a file at the location:
            <block name="" template="Foo_Bar::baz.phtml"/>
Want to learn more?

Visit to learn much more about Magento, Laravel, PHP, Javascript, & Docker. logo