Magento2 hello world displaying blank screenHow can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlHello World: Finally working but execute command visible on screenI created a custom module ,but getting error, not able to figure out what the error is about. How to get out of this error?main.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Hello World Module ErrorMagento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 Can't view module's front end page output?

What chord could the notes 'F A♭ E♭' form?

Is it safe to keep the GPU on 100% utilization for a very long time?

What's the difference between "ricochet" and "bounce"?

call() a function within its own context

Test whether a string is in a list with variable

How could a humanoid creature completely form within the span of 24 hours?

Justification of physical currency in an interstellar civilization?

Magical Modulo Squares

Are modes in jazz primarily a melody thing?

How can I draw a rectangle around venn Diagrams?

Do the Zhentarim fire members for killing fellow members?

How can I test a shell script in a "safe environment" to avoid harm to my computer?

If an attacker targets a creature with the Sanctuary spell cast on them, but fails the Wisdom save, can they choose not to attack anyone else?

A♭ major 9th chord in Bach is unexpectedly dissonant/jazzy

Select list elements based on other list

How do I give a darkroom course without negs from the attendees?

What detail can Hubble see on Mars?

Why is there a cap on 401k contributions?

Would a legitimized Baratheon have the best claim for the Iron Throne?

Picking a theme as a discovery writer

What is the Ancient One's mistake?

How does jetBlue determine its boarding order?

Why is the episode called "The Last of the Starks"?

What is more safe for browsing the web: PC or smartphone?



Magento2 hello world displaying blank screen


How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlHello World: Finally working but execute command visible on screenI created a custom module ,but getting error, not able to figure out what the error is about. How to get out of this error?main.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Hello World Module ErrorMagento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 Can't view module's front end page output?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I am trying to create a simple hello world module, I am able to successfully create and install the module but for some reason, my screen is showing up blank. But if I echo something in controller it shows up. Can anyone help me where exactly I am going wrong? Below is my code.



I have been following this Tutorials



-app
-code
-KK
-OneStepCheckOut
-Block
--Main.php
-Controller
-OneStepCheckOut
--BillingAddress.php
-etc
--module.xml
-frontend
--routes.xml
-view
-frontend
-layout
--oneStepCheckOut_oneStepCheckOut_billingAddress.xml
-templates
--content.phtml
--registration.php


Controller:-



<?php 

namespace kkOneStepCheckoutControllerOneStepCheckout;
use MagentoFrameworkViewResultPageFactory;
use MagentoFrameworkAppActionContext;
class BillingAddress extends MagentoFrameworkAppActionAction

/**
* @var PageFactory
*/
protected $pageFactory;
public function __construct(Context $context, PageFactory $pageFactory)

$this->pageFactory = $pageFactory;
return parent::__construct($context);


public function execute()

// echo "In controller";
$page_object = $this->pageFactory->create();
return $page_object;



?>


oneStepCheckOut_oneStepCheckOut_billingAddress.xml:-



<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="empty"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="content">
<block
template="kk_OneStepCheckOut::content.phtml"
class="kkOneStepCheckOutBlockMain"
name="oneStepCheckOut" />
</referenceContainer>
</body>
</page>


Main.php:-



<?php
namespace kkOneStepCheckOutBlock;

class Main extends MagentoFrameworkViewElementTemplate

public function _prepareLayout()

return parent::_prepareLayout();


?>


Content.phtml:-



<h1><?php echo "hello world"; ?></h1>


routes.xml:-



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<router id="standard">
<route id="oneStepCheckOut" frontName="oneStepCheckOut">
<module name="kk_OneStepCheckOut" />
</route>
</router>
</config>


module.xml:-



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="kk_OneStepCheckOut" setup_version="0.0.1" />
</config>









share|improve this question
























  • Change file name change oneStepCheckOut_oneStepCheckOut_billingAddress.xml` to onestepcheckout_onestepcheckout_billingaddress.xml

    – Amit Bera
    Mar 31 '17 at 13:21











  • Can use please tell me the <html> body class of this class

    – Amit Bera
    Mar 31 '17 at 13:21












  • @AmitBera class is onestepcheckout-onestepcheckout-billingaddress page-layout-admin-1column

    – 3bu1
    Apr 3 '17 at 6:37











  • Thanks, by changing xml page name i got it.And can u pls post it as answer with an explanation why it has to be small letters. it would help other beginners like me. Thank u very much

    – 3bu1
    Apr 3 '17 at 6:44

















0















I am trying to create a simple hello world module, I am able to successfully create and install the module but for some reason, my screen is showing up blank. But if I echo something in controller it shows up. Can anyone help me where exactly I am going wrong? Below is my code.



I have been following this Tutorials



-app
-code
-KK
-OneStepCheckOut
-Block
--Main.php
-Controller
-OneStepCheckOut
--BillingAddress.php
-etc
--module.xml
-frontend
--routes.xml
-view
-frontend
-layout
--oneStepCheckOut_oneStepCheckOut_billingAddress.xml
-templates
--content.phtml
--registration.php


Controller:-



<?php 

namespace kkOneStepCheckoutControllerOneStepCheckout;
use MagentoFrameworkViewResultPageFactory;
use MagentoFrameworkAppActionContext;
class BillingAddress extends MagentoFrameworkAppActionAction

/**
* @var PageFactory
*/
protected $pageFactory;
public function __construct(Context $context, PageFactory $pageFactory)

$this->pageFactory = $pageFactory;
return parent::__construct($context);


public function execute()

// echo "In controller";
$page_object = $this->pageFactory->create();
return $page_object;



?>


oneStepCheckOut_oneStepCheckOut_billingAddress.xml:-



<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="empty"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="content">
<block
template="kk_OneStepCheckOut::content.phtml"
class="kkOneStepCheckOutBlockMain"
name="oneStepCheckOut" />
</referenceContainer>
</body>
</page>


Main.php:-



<?php
namespace kkOneStepCheckOutBlock;

class Main extends MagentoFrameworkViewElementTemplate

public function _prepareLayout()

return parent::_prepareLayout();


?>


Content.phtml:-



<h1><?php echo "hello world"; ?></h1>


routes.xml:-



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<router id="standard">
<route id="oneStepCheckOut" frontName="oneStepCheckOut">
<module name="kk_OneStepCheckOut" />
</route>
</router>
</config>


module.xml:-



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="kk_OneStepCheckOut" setup_version="0.0.1" />
</config>









share|improve this question
























  • Change file name change oneStepCheckOut_oneStepCheckOut_billingAddress.xml` to onestepcheckout_onestepcheckout_billingaddress.xml

    – Amit Bera
    Mar 31 '17 at 13:21











  • Can use please tell me the <html> body class of this class

    – Amit Bera
    Mar 31 '17 at 13:21












  • @AmitBera class is onestepcheckout-onestepcheckout-billingaddress page-layout-admin-1column

    – 3bu1
    Apr 3 '17 at 6:37











  • Thanks, by changing xml page name i got it.And can u pls post it as answer with an explanation why it has to be small letters. it would help other beginners like me. Thank u very much

    – 3bu1
    Apr 3 '17 at 6:44













0












0








0








I am trying to create a simple hello world module, I am able to successfully create and install the module but for some reason, my screen is showing up blank. But if I echo something in controller it shows up. Can anyone help me where exactly I am going wrong? Below is my code.



I have been following this Tutorials



-app
-code
-KK
-OneStepCheckOut
-Block
--Main.php
-Controller
-OneStepCheckOut
--BillingAddress.php
-etc
--module.xml
-frontend
--routes.xml
-view
-frontend
-layout
--oneStepCheckOut_oneStepCheckOut_billingAddress.xml
-templates
--content.phtml
--registration.php


Controller:-



<?php 

namespace kkOneStepCheckoutControllerOneStepCheckout;
use MagentoFrameworkViewResultPageFactory;
use MagentoFrameworkAppActionContext;
class BillingAddress extends MagentoFrameworkAppActionAction

/**
* @var PageFactory
*/
protected $pageFactory;
public function __construct(Context $context, PageFactory $pageFactory)

$this->pageFactory = $pageFactory;
return parent::__construct($context);


public function execute()

// echo "In controller";
$page_object = $this->pageFactory->create();
return $page_object;



?>


oneStepCheckOut_oneStepCheckOut_billingAddress.xml:-



<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="empty"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="content">
<block
template="kk_OneStepCheckOut::content.phtml"
class="kkOneStepCheckOutBlockMain"
name="oneStepCheckOut" />
</referenceContainer>
</body>
</page>


Main.php:-



<?php
namespace kkOneStepCheckOutBlock;

class Main extends MagentoFrameworkViewElementTemplate

public function _prepareLayout()

return parent::_prepareLayout();


?>


Content.phtml:-



<h1><?php echo "hello world"; ?></h1>


routes.xml:-



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<router id="standard">
<route id="oneStepCheckOut" frontName="oneStepCheckOut">
<module name="kk_OneStepCheckOut" />
</route>
</router>
</config>


module.xml:-



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="kk_OneStepCheckOut" setup_version="0.0.1" />
</config>









share|improve this question
















I am trying to create a simple hello world module, I am able to successfully create and install the module but for some reason, my screen is showing up blank. But if I echo something in controller it shows up. Can anyone help me where exactly I am going wrong? Below is my code.



I have been following this Tutorials



-app
-code
-KK
-OneStepCheckOut
-Block
--Main.php
-Controller
-OneStepCheckOut
--BillingAddress.php
-etc
--module.xml
-frontend
--routes.xml
-view
-frontend
-layout
--oneStepCheckOut_oneStepCheckOut_billingAddress.xml
-templates
--content.phtml
--registration.php


Controller:-



<?php 

namespace kkOneStepCheckoutControllerOneStepCheckout;
use MagentoFrameworkViewResultPageFactory;
use MagentoFrameworkAppActionContext;
class BillingAddress extends MagentoFrameworkAppActionAction

/**
* @var PageFactory
*/
protected $pageFactory;
public function __construct(Context $context, PageFactory $pageFactory)

$this->pageFactory = $pageFactory;
return parent::__construct($context);


public function execute()

// echo "In controller";
$page_object = $this->pageFactory->create();
return $page_object;



?>


oneStepCheckOut_oneStepCheckOut_billingAddress.xml:-



<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="empty"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="content">
<block
template="kk_OneStepCheckOut::content.phtml"
class="kkOneStepCheckOutBlockMain"
name="oneStepCheckOut" />
</referenceContainer>
</body>
</page>


Main.php:-



<?php
namespace kkOneStepCheckOutBlock;

class Main extends MagentoFrameworkViewElementTemplate

public function _prepareLayout()

return parent::_prepareLayout();


?>


Content.phtml:-



<h1><?php echo "hello world"; ?></h1>


routes.xml:-



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<router id="standard">
<route id="oneStepCheckOut" frontName="oneStepCheckOut">
<module name="kk_OneStepCheckOut" />
</route>
</router>
</config>


module.xml:-



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="kk_OneStepCheckOut" setup_version="0.0.1" />
</config>






magento2 module layout






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 3 at 16:56









Ghulam.M

449113




449113










asked Mar 31 '17 at 13:09









3bu13bu1

1012




1012












  • Change file name change oneStepCheckOut_oneStepCheckOut_billingAddress.xml` to onestepcheckout_onestepcheckout_billingaddress.xml

    – Amit Bera
    Mar 31 '17 at 13:21











  • Can use please tell me the <html> body class of this class

    – Amit Bera
    Mar 31 '17 at 13:21












  • @AmitBera class is onestepcheckout-onestepcheckout-billingaddress page-layout-admin-1column

    – 3bu1
    Apr 3 '17 at 6:37











  • Thanks, by changing xml page name i got it.And can u pls post it as answer with an explanation why it has to be small letters. it would help other beginners like me. Thank u very much

    – 3bu1
    Apr 3 '17 at 6:44

















  • Change file name change oneStepCheckOut_oneStepCheckOut_billingAddress.xml` to onestepcheckout_onestepcheckout_billingaddress.xml

    – Amit Bera
    Mar 31 '17 at 13:21











  • Can use please tell me the <html> body class of this class

    – Amit Bera
    Mar 31 '17 at 13:21












  • @AmitBera class is onestepcheckout-onestepcheckout-billingaddress page-layout-admin-1column

    – 3bu1
    Apr 3 '17 at 6:37











  • Thanks, by changing xml page name i got it.And can u pls post it as answer with an explanation why it has to be small letters. it would help other beginners like me. Thank u very much

    – 3bu1
    Apr 3 '17 at 6:44
















Change file name change oneStepCheckOut_oneStepCheckOut_billingAddress.xml` to onestepcheckout_onestepcheckout_billingaddress.xml

– Amit Bera
Mar 31 '17 at 13:21





Change file name change oneStepCheckOut_oneStepCheckOut_billingAddress.xml` to onestepcheckout_onestepcheckout_billingaddress.xml

– Amit Bera
Mar 31 '17 at 13:21













Can use please tell me the <html> body class of this class

– Amit Bera
Mar 31 '17 at 13:21






Can use please tell me the <html> body class of this class

– Amit Bera
Mar 31 '17 at 13:21














@AmitBera class is onestepcheckout-onestepcheckout-billingaddress page-layout-admin-1column

– 3bu1
Apr 3 '17 at 6:37





@AmitBera class is onestepcheckout-onestepcheckout-billingaddress page-layout-admin-1column

– 3bu1
Apr 3 '17 at 6:37













Thanks, by changing xml page name i got it.And can u pls post it as answer with an explanation why it has to be small letters. it would help other beginners like me. Thank u very much

– 3bu1
Apr 3 '17 at 6:44





Thanks, by changing xml page name i got it.And can u pls post it as answer with an explanation why it has to be small letters. it would help other beginners like me. Thank u very much

– 3bu1
Apr 3 '17 at 6:44










1 Answer
1






active

oldest

votes


















0














Change layout XML file name. Magento layout xml file name always in small letters.



replace it



oneStepCheckOut_oneStepCheckOut_billingAddress.xml 


with file name



onestepcheckout_onestepcheckout_billingaddress.xml





share|improve this answer























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "479"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f167150%2fmagento2-hello-world-displaying-blank-screen%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Change layout XML file name. Magento layout xml file name always in small letters.



    replace it



    oneStepCheckOut_oneStepCheckOut_billingAddress.xml 


    with file name



    onestepcheckout_onestepcheckout_billingaddress.xml





    share|improve this answer



























      0














      Change layout XML file name. Magento layout xml file name always in small letters.



      replace it



      oneStepCheckOut_oneStepCheckOut_billingAddress.xml 


      with file name



      onestepcheckout_onestepcheckout_billingaddress.xml





      share|improve this answer

























        0












        0








        0







        Change layout XML file name. Magento layout xml file name always in small letters.



        replace it



        oneStepCheckOut_oneStepCheckOut_billingAddress.xml 


        with file name



        onestepcheckout_onestepcheckout_billingaddress.xml





        share|improve this answer













        Change layout XML file name. Magento layout xml file name always in small letters.



        replace it



        oneStepCheckOut_oneStepCheckOut_billingAddress.xml 


        with file name



        onestepcheckout_onestepcheckout_billingaddress.xml






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered May 3 at 18:13









        Shailesh KatarmalShailesh Katarmal

        1345




        1345



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f167150%2fmagento2-hello-world-displaying-blank-screen%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

            Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

            Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?