Skip to main content
added 236 characters in body
Source Link
Abdul
  • 9.7k
  • 1
  • 21
  • 43

Try below steps

Step:1 Create default.xmlat location app\code\<Vendor-Name>\<Module-Name>\view\frontend\layout and add below code

<referenceContainer name="page.top">
    <block class="Magento\Framework\View\Element\Template" name="custom-block-name" template="<Vendor-Name>_<Module-Name>::page\custom.phtml"/>
</referenceContainer>

OR

 <referenceContainer name="main.content">
    <block class="Magento\Framework\View\Element\Template" name="custom-block-name" template="<Vendor-Name>_<Module-Name>::page\custom.phtml"/>
</referenceContainer>

Step:2 Create custom.phtml at location app\code\<Vendor-Name>\<Module-Name>\view\frontend\templates\page\ and add your code

for eg.

<?php 
     echo "Custom Block";
?>

Step:3 After run compile command

php bin/magento setup:di:compile

Try below steps

Step:1 Create default.xmlat location app\code\<Vendor-Name>\<Module-Name>\view\frontend\layout and add below code

<referenceContainer name="page.top">
    <block class="Magento\Framework\View\Element\Template" name="custom-block-name" template="<Vendor-Name>_<Module-Name>::page\custom.phtml"/>
</referenceContainer>

Step:2 Create custom.phtml at location app\code\<Vendor-Name>\<Module-Name>\view\frontend\templates\page\ and add your code

for eg.

<?php 
     echo "Custom Block";
?>

Step:3 After run compile command

php bin/magento setup:di:compile

Try below steps

Step:1 Create default.xmlat location app\code\<Vendor-Name>\<Module-Name>\view\frontend\layout and add below code

<referenceContainer name="page.top">
    <block class="Magento\Framework\View\Element\Template" name="custom-block-name" template="<Vendor-Name>_<Module-Name>::page\custom.phtml"/>
</referenceContainer>

OR

 <referenceContainer name="main.content">
    <block class="Magento\Framework\View\Element\Template" name="custom-block-name" template="<Vendor-Name>_<Module-Name>::page\custom.phtml"/>
</referenceContainer>

Step:2 Create custom.phtml at location app\code\<Vendor-Name>\<Module-Name>\view\frontend\templates\page\ and add your code

for eg.

<?php 
     echo "Custom Block";
?>

Step:3 After run compile command

php bin/magento setup:di:compile
deleted 4 characters in body
Source Link
Abdul
  • 9.7k
  • 1
  • 21
  • 43

Try below steps

Step:1 Create default.xmlat location app\code\<Vendor-Name>\<Module-Name>\view\frontend\layout and add below code

<referenceContainer name="mainname="page.content">top">
    <block class="Magento\Framework\View\Element\Template" name="custom-block-name" template="<Vendor-Name>_<Module-Name>::page\custom.phtml"/>
</referenceContainer>

Step:2 Create custom.phtml at location app\code\<Vendor-Name>\<Module-Name>\view\frontend\templates\page\ and add your code

for eg.

<?php 
     echo "Custom Block";
?>

Step:3 After run compile command

php bin/magento setup:di:compile

Try below steps

Step:1 Create default.xmlat location app\code\<Vendor-Name>\<Module-Name>\view\frontend\layout and add below code

<referenceContainer name="main.content">
    <block class="Magento\Framework\View\Element\Template" name="custom-block-name" template="<Vendor-Name>_<Module-Name>::page\custom.phtml"/>
</referenceContainer>

Step:2 Create custom.phtml at location app\code\<Vendor-Name>\<Module-Name>\view\frontend\templates\page\ and add your code

for eg.

<?php 
     echo "Custom Block";
?>

Step:3 After run compile command

php bin/magento setup:di:compile

Try below steps

Step:1 Create default.xmlat location app\code\<Vendor-Name>\<Module-Name>\view\frontend\layout and add below code

<referenceContainer name="page.top">
    <block class="Magento\Framework\View\Element\Template" name="custom-block-name" template="<Vendor-Name>_<Module-Name>::page\custom.phtml"/>
</referenceContainer>

Step:2 Create custom.phtml at location app\code\<Vendor-Name>\<Module-Name>\view\frontend\templates\page\ and add your code

for eg.

<?php 
     echo "Custom Block";
?>

Step:3 After run compile command

php bin/magento setup:di:compile
Source Link
Abdul
  • 9.7k
  • 1
  • 21
  • 43

Try below steps

Step:1 Create default.xmlat location app\code\<Vendor-Name>\<Module-Name>\view\frontend\layout and add below code

<referenceContainer name="main.content">
    <block class="Magento\Framework\View\Element\Template" name="custom-block-name" template="<Vendor-Name>_<Module-Name>::page\custom.phtml"/>
</referenceContainer>

Step:2 Create custom.phtml at location app\code\<Vendor-Name>\<Module-Name>\view\frontend\templates\page\ and add your code

for eg.

<?php 
     echo "Custom Block";
?>

Step:3 After run compile command

php bin/magento setup:di:compile