I’ve created a custom theme: app/design/frontend/TestVendor/testTheme with registration.php and theme.xml files.
Inside the testTheme folder I’ve created another folder: TestFolder and inside this folder another 2 folders and files inside them:
- TestFolder/layout/default.xml
- TestFolder/templates/mainpage.phtml
This is how the structure looks like:
-TestVendor
—testTheme
——registration.php
——theme.xml
——TestFolder
——–templates
———–mainpage.phtml
———layout
———–default.xml
This is how default magento html skeleton looks like:
I want to add a new content inside the div element with the class name of “column main”. I searched and this html was defined in vendor/magento/module-theme/view/base/page_layout/empty.xml as the container tag with the name of “main”
So I just did 2 things:
- added html tags with texsts to templates/mainpage.phtml.
- configured the layout/default.xml file and applied the theme to the website
This is how my default.xml file looks like:
<?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">
<referenceContainer name="main">
<block class="MagentoFrameworkViewElementTemplate" name="slide" template="TestFolder::mainpage.phtml"/>
</referenceContainer>
</page>
But mainpage.phtml content is not being rendered inside the “column main” div element. Am I doing something wrong? Any kind of help would be apreciated