Magento2 sample custom admin module showing blank page Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?How can i rewrite TierPrice Block in Magento2Magento2 - Custom Admin Module - UI Form Component showing blank pagemagento 2 captcha not rendering if I override layout xmlI 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?Magento 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?Deleted ShipperHQ module causing error in “All Customers” section of Magento 2
Do wooden building fires get hotter than 600°C?
Can you use the Shield Master feat to shove someone before you make an attack by using a Readied action?
First console to have temporary backward compatibility
Denied boarding although I have proper visa and documentation. To whom should I make a complaint?
Is it common practice to audition new musicians one-on-one before rehearsing with the entire band?
What does "lightly crushed" mean for cardamon pods?
Why do we bend a book to keep it straight?
Can a party unilaterally change candidates in preparation for a General election?
Has negative voting ever been officially implemented in elections, or seriously proposed, or even studied?
How can I use the Python library networkx from Mathematica?
Why are there no cargo aircraft with "flying wing" design?
What do you call the main part of a joke?
Is it fair for a professor to grade us on the possession of past papers?
Circuit to "zoom in" on mV fluctuations of a DC signal?
Wu formula for manifolds with boundary
Maximum summed powersets with non-adjacent items
How do I find out the mythology and history of my Fortress?
Around usage results
Dating a Former Employee
Would "destroying" Wurmcoil Engine prevent its tokens from being created?
How to convince students of the implication truth values?
Is there such thing as an Availability Group failover trigger?
Fantasy story; one type of magic grows in power with use, but the more powerful they are, they more they are drawn to travel to their source
Does classifying an integer as a discrete log require it be part of a multiplicative group?
Magento2 sample custom admin module showing blank page
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?How can i rewrite TierPrice Block in Magento2Magento2 - Custom Admin Module - UI Form Component showing blank pagemagento 2 captcha not rendering if I override layout xmlI 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?Magento 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?Deleted ShipperHQ module causing error in “All Customers” section of Magento 2
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am trying to display something when click on a link from admin menu. So i created a simple module and when i click from the admin menu it redirect to mydomain/secure-manage/helloworld/index/index/key/... with status 200 but the page is blank.
In devtool i can see the css and js are loaded but nothing inside the body tag.
1.folder structure
Inchoo
Helloworld
-Block
-Adminhtml
Helloworld.php
-Controller
-Adminhtml
-Index
Index.php
-etc
-module.xml
-adminhtml
-menu.xml
-routes.xml
-view
adminhtml
layout
-helloworld_index_index.xml
templates
-helloworld.phtml
registration.php
2.Block/Adminhtml/Helloworld.php
<?php
namespace InchooHelloworldBlock;
class Helloworld extends MagentoFrameworkViewElementTemplate
public function getHelloWorldTxt()
return 'Hello world!';
3.Controller/Adminhtml/Index/Index.php
<?php
namespace InchooHelloworldControllerAdminhtmlIndex;
use MagentoFrameworkAppActionContext;
class Index extends MagentoFrameworkAppActionAction
protected $_resultPageFactory;
public function __construct(Context $context,
MagentoFrameworkViewResultPageFactory $resultPageFactory)
$this->_resultPageFactory = $resultPageFactory;
parent::__construct($context);
public function execute()
$resultPage = $this->_resultPageFactory->create();
// print_r($resultPage);exit;
return $resultPage;
4.etc/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="Inchoo_Helloworld" setup_version="1.0.0">
</module>
</config>
5.etc/adminhtml/menu.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc
/menu.xsd">
<menu>
<add id="Inchoo_Helloworld::first_pincollect_pincheck"
title="Greetings"
module="Inchoo_Helloworld"
sortOrder="50"
dependsOnModule="Inchoo_Helloworld"
resource="Magento_Backend::content" />
<add id="Inchoo_Helloworld::second_pincollect_pincheck"
title="Manage Pincodes"
module="Inchoo_Helloworld"
sortOrder="0"
action="helloworld/index"
parent="Inchoo_Helloworld::first_pincollect_pincheck"
resource="Magento_Backend::content" />
</menu>
</config>
6.etc/adminhtml/routes.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc
/routes.xsd">
<router id="admin">
<route id="helloworld" frontName="helloworld">
<module name="Inchoo_Helloworld" />
</route>
</router>
</config>
7.view/adminhtml/layout/helloworld_index_index.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../../lib/
internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"
layout="1column">
<body>
<referenceContainer name="content">
<block class="InchooHelloworldBlockAdminhtmlHelloworld"
name="helloworld" template="helloworld.phtml" />
</referenceContainer>
</body>
</page>
8.view/adminhtml/templates/helloworld.phtml
<p>Hello World!</p>
how can i debug this, please help me guys.
Thanks in advance.
magento2
add a comment |
I am trying to display something when click on a link from admin menu. So i created a simple module and when i click from the admin menu it redirect to mydomain/secure-manage/helloworld/index/index/key/... with status 200 but the page is blank.
In devtool i can see the css and js are loaded but nothing inside the body tag.
1.folder structure
Inchoo
Helloworld
-Block
-Adminhtml
Helloworld.php
-Controller
-Adminhtml
-Index
Index.php
-etc
-module.xml
-adminhtml
-menu.xml
-routes.xml
-view
adminhtml
layout
-helloworld_index_index.xml
templates
-helloworld.phtml
registration.php
2.Block/Adminhtml/Helloworld.php
<?php
namespace InchooHelloworldBlock;
class Helloworld extends MagentoFrameworkViewElementTemplate
public function getHelloWorldTxt()
return 'Hello world!';
3.Controller/Adminhtml/Index/Index.php
<?php
namespace InchooHelloworldControllerAdminhtmlIndex;
use MagentoFrameworkAppActionContext;
class Index extends MagentoFrameworkAppActionAction
protected $_resultPageFactory;
public function __construct(Context $context,
MagentoFrameworkViewResultPageFactory $resultPageFactory)
$this->_resultPageFactory = $resultPageFactory;
parent::__construct($context);
public function execute()
$resultPage = $this->_resultPageFactory->create();
// print_r($resultPage);exit;
return $resultPage;
4.etc/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="Inchoo_Helloworld" setup_version="1.0.0">
</module>
</config>
5.etc/adminhtml/menu.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc
/menu.xsd">
<menu>
<add id="Inchoo_Helloworld::first_pincollect_pincheck"
title="Greetings"
module="Inchoo_Helloworld"
sortOrder="50"
dependsOnModule="Inchoo_Helloworld"
resource="Magento_Backend::content" />
<add id="Inchoo_Helloworld::second_pincollect_pincheck"
title="Manage Pincodes"
module="Inchoo_Helloworld"
sortOrder="0"
action="helloworld/index"
parent="Inchoo_Helloworld::first_pincollect_pincheck"
resource="Magento_Backend::content" />
</menu>
</config>
6.etc/adminhtml/routes.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc
/routes.xsd">
<router id="admin">
<route id="helloworld" frontName="helloworld">
<module name="Inchoo_Helloworld" />
</route>
</router>
</config>
7.view/adminhtml/layout/helloworld_index_index.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../../lib/
internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"
layout="1column">
<body>
<referenceContainer name="content">
<block class="InchooHelloworldBlockAdminhtmlHelloworld"
name="helloworld" template="helloworld.phtml" />
</referenceContainer>
</body>
</page>
8.view/adminhtml/templates/helloworld.phtml
<p>Hello World!</p>
how can i debug this, please help me guys.
Thanks in advance.
magento2
have you run deploy and cache flush command from cli
– Bachcha Singh
Jan 17 '18 at 8:43
Hi Bachcha Singh, tried but no luck.
– Vivek Xavier
Jan 17 '18 at 9:27
add a comment |
I am trying to display something when click on a link from admin menu. So i created a simple module and when i click from the admin menu it redirect to mydomain/secure-manage/helloworld/index/index/key/... with status 200 but the page is blank.
In devtool i can see the css and js are loaded but nothing inside the body tag.
1.folder structure
Inchoo
Helloworld
-Block
-Adminhtml
Helloworld.php
-Controller
-Adminhtml
-Index
Index.php
-etc
-module.xml
-adminhtml
-menu.xml
-routes.xml
-view
adminhtml
layout
-helloworld_index_index.xml
templates
-helloworld.phtml
registration.php
2.Block/Adminhtml/Helloworld.php
<?php
namespace InchooHelloworldBlock;
class Helloworld extends MagentoFrameworkViewElementTemplate
public function getHelloWorldTxt()
return 'Hello world!';
3.Controller/Adminhtml/Index/Index.php
<?php
namespace InchooHelloworldControllerAdminhtmlIndex;
use MagentoFrameworkAppActionContext;
class Index extends MagentoFrameworkAppActionAction
protected $_resultPageFactory;
public function __construct(Context $context,
MagentoFrameworkViewResultPageFactory $resultPageFactory)
$this->_resultPageFactory = $resultPageFactory;
parent::__construct($context);
public function execute()
$resultPage = $this->_resultPageFactory->create();
// print_r($resultPage);exit;
return $resultPage;
4.etc/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="Inchoo_Helloworld" setup_version="1.0.0">
</module>
</config>
5.etc/adminhtml/menu.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc
/menu.xsd">
<menu>
<add id="Inchoo_Helloworld::first_pincollect_pincheck"
title="Greetings"
module="Inchoo_Helloworld"
sortOrder="50"
dependsOnModule="Inchoo_Helloworld"
resource="Magento_Backend::content" />
<add id="Inchoo_Helloworld::second_pincollect_pincheck"
title="Manage Pincodes"
module="Inchoo_Helloworld"
sortOrder="0"
action="helloworld/index"
parent="Inchoo_Helloworld::first_pincollect_pincheck"
resource="Magento_Backend::content" />
</menu>
</config>
6.etc/adminhtml/routes.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc
/routes.xsd">
<router id="admin">
<route id="helloworld" frontName="helloworld">
<module name="Inchoo_Helloworld" />
</route>
</router>
</config>
7.view/adminhtml/layout/helloworld_index_index.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../../lib/
internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"
layout="1column">
<body>
<referenceContainer name="content">
<block class="InchooHelloworldBlockAdminhtmlHelloworld"
name="helloworld" template="helloworld.phtml" />
</referenceContainer>
</body>
</page>
8.view/adminhtml/templates/helloworld.phtml
<p>Hello World!</p>
how can i debug this, please help me guys.
Thanks in advance.
magento2
I am trying to display something when click on a link from admin menu. So i created a simple module and when i click from the admin menu it redirect to mydomain/secure-manage/helloworld/index/index/key/... with status 200 but the page is blank.
In devtool i can see the css and js are loaded but nothing inside the body tag.
1.folder structure
Inchoo
Helloworld
-Block
-Adminhtml
Helloworld.php
-Controller
-Adminhtml
-Index
Index.php
-etc
-module.xml
-adminhtml
-menu.xml
-routes.xml
-view
adminhtml
layout
-helloworld_index_index.xml
templates
-helloworld.phtml
registration.php
2.Block/Adminhtml/Helloworld.php
<?php
namespace InchooHelloworldBlock;
class Helloworld extends MagentoFrameworkViewElementTemplate
public function getHelloWorldTxt()
return 'Hello world!';
3.Controller/Adminhtml/Index/Index.php
<?php
namespace InchooHelloworldControllerAdminhtmlIndex;
use MagentoFrameworkAppActionContext;
class Index extends MagentoFrameworkAppActionAction
protected $_resultPageFactory;
public function __construct(Context $context,
MagentoFrameworkViewResultPageFactory $resultPageFactory)
$this->_resultPageFactory = $resultPageFactory;
parent::__construct($context);
public function execute()
$resultPage = $this->_resultPageFactory->create();
// print_r($resultPage);exit;
return $resultPage;
4.etc/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="Inchoo_Helloworld" setup_version="1.0.0">
</module>
</config>
5.etc/adminhtml/menu.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc
/menu.xsd">
<menu>
<add id="Inchoo_Helloworld::first_pincollect_pincheck"
title="Greetings"
module="Inchoo_Helloworld"
sortOrder="50"
dependsOnModule="Inchoo_Helloworld"
resource="Magento_Backend::content" />
<add id="Inchoo_Helloworld::second_pincollect_pincheck"
title="Manage Pincodes"
module="Inchoo_Helloworld"
sortOrder="0"
action="helloworld/index"
parent="Inchoo_Helloworld::first_pincollect_pincheck"
resource="Magento_Backend::content" />
</menu>
</config>
6.etc/adminhtml/routes.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc
/routes.xsd">
<router id="admin">
<route id="helloworld" frontName="helloworld">
<module name="Inchoo_Helloworld" />
</route>
</router>
</config>
7.view/adminhtml/layout/helloworld_index_index.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../../lib/
internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"
layout="1column">
<body>
<referenceContainer name="content">
<block class="InchooHelloworldBlockAdminhtmlHelloworld"
name="helloworld" template="helloworld.phtml" />
</referenceContainer>
</body>
</page>
8.view/adminhtml/templates/helloworld.phtml
<p>Hello World!</p>
how can i debug this, please help me guys.
Thanks in advance.
magento2
magento2
edited Jan 17 '18 at 8:16
Vivek Xavier
asked Jan 17 '18 at 6:51
Vivek XavierVivek Xavier
83
83
have you run deploy and cache flush command from cli
– Bachcha Singh
Jan 17 '18 at 8:43
Hi Bachcha Singh, tried but no luck.
– Vivek Xavier
Jan 17 '18 at 9:27
add a comment |
have you run deploy and cache flush command from cli
– Bachcha Singh
Jan 17 '18 at 8:43
Hi Bachcha Singh, tried but no luck.
– Vivek Xavier
Jan 17 '18 at 9:27
have you run deploy and cache flush command from cli
– Bachcha Singh
Jan 17 '18 at 8:43
have you run deploy and cache flush command from cli
– Bachcha Singh
Jan 17 '18 at 8:43
Hi Bachcha Singh, tried but no luck.
– Vivek Xavier
Jan 17 '18 at 9:27
Hi Bachcha Singh, tried but no luck.
– Vivek Xavier
Jan 17 '18 at 9:27
add a comment |
3 Answers
3
active
oldest
votes
I am giving you the exact code and path please copy and paste the below file.
app/code/Inchoo/Helloworld/registration.php
<?php
MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::MODULE,
'Inchoo_Helloworld',
__DIR__
);
app/code/Inchoo/Helloworld/Block/Adminhtml/Index/Index.php
<?php
namespace InchooHelloworldBlockAdminhtmlIndex;
class Index extends MagentoBackendBlockWidgetContainer
public function __construct(MagentoBackendBlockWidgetContext $context,array $data = [])
parent::__construct($context, $data);
app/code/Inchoo/Helloworld/Controller/Adminhtml/Index/Index.php
<?php
namespace InchooHelloworldControllerAdminhtmlIndex;
class Index extends MagentoBackendAppAction
public function execute()
$this->_view->loadLayout();
$this->_view->getLayout()->initMessages();
$this->_view->renderLayout();
?>
app/code/Inchoo/Helloworld/etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
<module name="Inchoo_Helloworld" setup_version="1.0.0"></module>
<sequence>
<module name="Magento_Backend"/>
<module name="Magento_Sales"/>
<module name="Magento_Quote"/>
<module name="Magento_Checkout"/>
</sequence>
</config>
app/code/Inchoo/Helloworld/etc/adminhtml/routes.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd">
<router id="admin">
<route id="helloworld" frontName="helloworld">
<module name="Inchoo_Helloworld" before="Magento_Adminhtml" />
</route>
</router>
</config>
app/code/Inchoo/Helloworld/etc/adminhtml/menu.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Magento/Backend/etc/menu.xsd">
<menu>
<add id="Inchoo_Helloworld::parent" title="Helloworld" module="Inchoo_Helloworld" sortOrder="100" resource="Inchoo_Helloworld::parent"/>
<add id="Inchoo_Helloworld::index" title="Helloworld Index" module="Inchoo_Helloworld" sortOrder="10" action="helloworld/index" resource="Inchoo_Helloworld::index" parent="Inchoo_Helloworld::parent"/>
</menu>
</config>
app/code/Inchoo/Helloworld/view/adminhtml/layout/helloworld_index_index.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
<head>
<title>Hello World</title>
</head>
<body>
<referenceContainer name="content">
<block class="InchooHelloworldBlockAdminhtmlIndexIndex" name="helloworld_block_adminhtml_index_index" template="Inchoo_Helloworld::helloworld_index_index.phtml" />
</referenceContainer>
</body>
</page>
app/code/Inchoo/Helloworld/view/adminhtml/templates/helloworld_index_index.phtml
<?php echo "Hello World template"; ?>
N:B After put all the files to the specific path don't forget to run this command from CLI -
php bin/magento setup:upgrade
php bin/magento cache:flush
My Pleasure..... @ Vivek. Feel free to like this answer.
– Soumik Rana
Jan 17 '18 at 10:48
add a comment |
First correct your folder structure name, Like
Inchoo
Helloworld
-Block
-Adminhtml
Helloworld.php
-Controller
-Adminhtml
-Index
-Index.php
-etc
-module.xml
-adminhtml
-menu.xml
-routes.xml
-view
-adminhtml
-layout
-helloworld_index_index.xml
-templates
-helloworld.phtml
-registration.php
hi rishabh, i corrected the structure like updated in the question but still not working.
– Vivek Xavier
Jan 17 '18 at 8:11
add a comment |
i was also facing the same issue Magento 2.3 CE. I gave the proper permissions for var and pub directories and ran the following commands-
- provided file permission for var/ and pub/
- setup:upgrade
- setup:static-content:deploy -f
- cache:flush
and it started to work.
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f209739%2fmagento2-sample-custom-admin-module-showing-blank-page%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
I am giving you the exact code and path please copy and paste the below file.
app/code/Inchoo/Helloworld/registration.php
<?php
MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::MODULE,
'Inchoo_Helloworld',
__DIR__
);
app/code/Inchoo/Helloworld/Block/Adminhtml/Index/Index.php
<?php
namespace InchooHelloworldBlockAdminhtmlIndex;
class Index extends MagentoBackendBlockWidgetContainer
public function __construct(MagentoBackendBlockWidgetContext $context,array $data = [])
parent::__construct($context, $data);
app/code/Inchoo/Helloworld/Controller/Adminhtml/Index/Index.php
<?php
namespace InchooHelloworldControllerAdminhtmlIndex;
class Index extends MagentoBackendAppAction
public function execute()
$this->_view->loadLayout();
$this->_view->getLayout()->initMessages();
$this->_view->renderLayout();
?>
app/code/Inchoo/Helloworld/etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
<module name="Inchoo_Helloworld" setup_version="1.0.0"></module>
<sequence>
<module name="Magento_Backend"/>
<module name="Magento_Sales"/>
<module name="Magento_Quote"/>
<module name="Magento_Checkout"/>
</sequence>
</config>
app/code/Inchoo/Helloworld/etc/adminhtml/routes.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd">
<router id="admin">
<route id="helloworld" frontName="helloworld">
<module name="Inchoo_Helloworld" before="Magento_Adminhtml" />
</route>
</router>
</config>
app/code/Inchoo/Helloworld/etc/adminhtml/menu.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Magento/Backend/etc/menu.xsd">
<menu>
<add id="Inchoo_Helloworld::parent" title="Helloworld" module="Inchoo_Helloworld" sortOrder="100" resource="Inchoo_Helloworld::parent"/>
<add id="Inchoo_Helloworld::index" title="Helloworld Index" module="Inchoo_Helloworld" sortOrder="10" action="helloworld/index" resource="Inchoo_Helloworld::index" parent="Inchoo_Helloworld::parent"/>
</menu>
</config>
app/code/Inchoo/Helloworld/view/adminhtml/layout/helloworld_index_index.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
<head>
<title>Hello World</title>
</head>
<body>
<referenceContainer name="content">
<block class="InchooHelloworldBlockAdminhtmlIndexIndex" name="helloworld_block_adminhtml_index_index" template="Inchoo_Helloworld::helloworld_index_index.phtml" />
</referenceContainer>
</body>
</page>
app/code/Inchoo/Helloworld/view/adminhtml/templates/helloworld_index_index.phtml
<?php echo "Hello World template"; ?>
N:B After put all the files to the specific path don't forget to run this command from CLI -
php bin/magento setup:upgrade
php bin/magento cache:flush
My Pleasure..... @ Vivek. Feel free to like this answer.
– Soumik Rana
Jan 17 '18 at 10:48
add a comment |
I am giving you the exact code and path please copy and paste the below file.
app/code/Inchoo/Helloworld/registration.php
<?php
MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::MODULE,
'Inchoo_Helloworld',
__DIR__
);
app/code/Inchoo/Helloworld/Block/Adminhtml/Index/Index.php
<?php
namespace InchooHelloworldBlockAdminhtmlIndex;
class Index extends MagentoBackendBlockWidgetContainer
public function __construct(MagentoBackendBlockWidgetContext $context,array $data = [])
parent::__construct($context, $data);
app/code/Inchoo/Helloworld/Controller/Adminhtml/Index/Index.php
<?php
namespace InchooHelloworldControllerAdminhtmlIndex;
class Index extends MagentoBackendAppAction
public function execute()
$this->_view->loadLayout();
$this->_view->getLayout()->initMessages();
$this->_view->renderLayout();
?>
app/code/Inchoo/Helloworld/etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
<module name="Inchoo_Helloworld" setup_version="1.0.0"></module>
<sequence>
<module name="Magento_Backend"/>
<module name="Magento_Sales"/>
<module name="Magento_Quote"/>
<module name="Magento_Checkout"/>
</sequence>
</config>
app/code/Inchoo/Helloworld/etc/adminhtml/routes.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd">
<router id="admin">
<route id="helloworld" frontName="helloworld">
<module name="Inchoo_Helloworld" before="Magento_Adminhtml" />
</route>
</router>
</config>
app/code/Inchoo/Helloworld/etc/adminhtml/menu.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Magento/Backend/etc/menu.xsd">
<menu>
<add id="Inchoo_Helloworld::parent" title="Helloworld" module="Inchoo_Helloworld" sortOrder="100" resource="Inchoo_Helloworld::parent"/>
<add id="Inchoo_Helloworld::index" title="Helloworld Index" module="Inchoo_Helloworld" sortOrder="10" action="helloworld/index" resource="Inchoo_Helloworld::index" parent="Inchoo_Helloworld::parent"/>
</menu>
</config>
app/code/Inchoo/Helloworld/view/adminhtml/layout/helloworld_index_index.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
<head>
<title>Hello World</title>
</head>
<body>
<referenceContainer name="content">
<block class="InchooHelloworldBlockAdminhtmlIndexIndex" name="helloworld_block_adminhtml_index_index" template="Inchoo_Helloworld::helloworld_index_index.phtml" />
</referenceContainer>
</body>
</page>
app/code/Inchoo/Helloworld/view/adminhtml/templates/helloworld_index_index.phtml
<?php echo "Hello World template"; ?>
N:B After put all the files to the specific path don't forget to run this command from CLI -
php bin/magento setup:upgrade
php bin/magento cache:flush
My Pleasure..... @ Vivek. Feel free to like this answer.
– Soumik Rana
Jan 17 '18 at 10:48
add a comment |
I am giving you the exact code and path please copy and paste the below file.
app/code/Inchoo/Helloworld/registration.php
<?php
MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::MODULE,
'Inchoo_Helloworld',
__DIR__
);
app/code/Inchoo/Helloworld/Block/Adminhtml/Index/Index.php
<?php
namespace InchooHelloworldBlockAdminhtmlIndex;
class Index extends MagentoBackendBlockWidgetContainer
public function __construct(MagentoBackendBlockWidgetContext $context,array $data = [])
parent::__construct($context, $data);
app/code/Inchoo/Helloworld/Controller/Adminhtml/Index/Index.php
<?php
namespace InchooHelloworldControllerAdminhtmlIndex;
class Index extends MagentoBackendAppAction
public function execute()
$this->_view->loadLayout();
$this->_view->getLayout()->initMessages();
$this->_view->renderLayout();
?>
app/code/Inchoo/Helloworld/etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
<module name="Inchoo_Helloworld" setup_version="1.0.0"></module>
<sequence>
<module name="Magento_Backend"/>
<module name="Magento_Sales"/>
<module name="Magento_Quote"/>
<module name="Magento_Checkout"/>
</sequence>
</config>
app/code/Inchoo/Helloworld/etc/adminhtml/routes.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd">
<router id="admin">
<route id="helloworld" frontName="helloworld">
<module name="Inchoo_Helloworld" before="Magento_Adminhtml" />
</route>
</router>
</config>
app/code/Inchoo/Helloworld/etc/adminhtml/menu.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Magento/Backend/etc/menu.xsd">
<menu>
<add id="Inchoo_Helloworld::parent" title="Helloworld" module="Inchoo_Helloworld" sortOrder="100" resource="Inchoo_Helloworld::parent"/>
<add id="Inchoo_Helloworld::index" title="Helloworld Index" module="Inchoo_Helloworld" sortOrder="10" action="helloworld/index" resource="Inchoo_Helloworld::index" parent="Inchoo_Helloworld::parent"/>
</menu>
</config>
app/code/Inchoo/Helloworld/view/adminhtml/layout/helloworld_index_index.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
<head>
<title>Hello World</title>
</head>
<body>
<referenceContainer name="content">
<block class="InchooHelloworldBlockAdminhtmlIndexIndex" name="helloworld_block_adminhtml_index_index" template="Inchoo_Helloworld::helloworld_index_index.phtml" />
</referenceContainer>
</body>
</page>
app/code/Inchoo/Helloworld/view/adminhtml/templates/helloworld_index_index.phtml
<?php echo "Hello World template"; ?>
N:B After put all the files to the specific path don't forget to run this command from CLI -
php bin/magento setup:upgrade
php bin/magento cache:flush
I am giving you the exact code and path please copy and paste the below file.
app/code/Inchoo/Helloworld/registration.php
<?php
MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::MODULE,
'Inchoo_Helloworld',
__DIR__
);
app/code/Inchoo/Helloworld/Block/Adminhtml/Index/Index.php
<?php
namespace InchooHelloworldBlockAdminhtmlIndex;
class Index extends MagentoBackendBlockWidgetContainer
public function __construct(MagentoBackendBlockWidgetContext $context,array $data = [])
parent::__construct($context, $data);
app/code/Inchoo/Helloworld/Controller/Adminhtml/Index/Index.php
<?php
namespace InchooHelloworldControllerAdminhtmlIndex;
class Index extends MagentoBackendAppAction
public function execute()
$this->_view->loadLayout();
$this->_view->getLayout()->initMessages();
$this->_view->renderLayout();
?>
app/code/Inchoo/Helloworld/etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
<module name="Inchoo_Helloworld" setup_version="1.0.0"></module>
<sequence>
<module name="Magento_Backend"/>
<module name="Magento_Sales"/>
<module name="Magento_Quote"/>
<module name="Magento_Checkout"/>
</sequence>
</config>
app/code/Inchoo/Helloworld/etc/adminhtml/routes.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd">
<router id="admin">
<route id="helloworld" frontName="helloworld">
<module name="Inchoo_Helloworld" before="Magento_Adminhtml" />
</route>
</router>
</config>
app/code/Inchoo/Helloworld/etc/adminhtml/menu.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Magento/Backend/etc/menu.xsd">
<menu>
<add id="Inchoo_Helloworld::parent" title="Helloworld" module="Inchoo_Helloworld" sortOrder="100" resource="Inchoo_Helloworld::parent"/>
<add id="Inchoo_Helloworld::index" title="Helloworld Index" module="Inchoo_Helloworld" sortOrder="10" action="helloworld/index" resource="Inchoo_Helloworld::index" parent="Inchoo_Helloworld::parent"/>
</menu>
</config>
app/code/Inchoo/Helloworld/view/adminhtml/layout/helloworld_index_index.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
<head>
<title>Hello World</title>
</head>
<body>
<referenceContainer name="content">
<block class="InchooHelloworldBlockAdminhtmlIndexIndex" name="helloworld_block_adminhtml_index_index" template="Inchoo_Helloworld::helloworld_index_index.phtml" />
</referenceContainer>
</body>
</page>
app/code/Inchoo/Helloworld/view/adminhtml/templates/helloworld_index_index.phtml
<?php echo "Hello World template"; ?>
N:B After put all the files to the specific path don't forget to run this command from CLI -
php bin/magento setup:upgrade
php bin/magento cache:flush
answered Jan 17 '18 at 9:10
Soumik RanaSoumik Rana
1577
1577
My Pleasure..... @ Vivek. Feel free to like this answer.
– Soumik Rana
Jan 17 '18 at 10:48
add a comment |
My Pleasure..... @ Vivek. Feel free to like this answer.
– Soumik Rana
Jan 17 '18 at 10:48
My Pleasure..... @ Vivek. Feel free to like this answer.
– Soumik Rana
Jan 17 '18 at 10:48
My Pleasure..... @ Vivek. Feel free to like this answer.
– Soumik Rana
Jan 17 '18 at 10:48
add a comment |
First correct your folder structure name, Like
Inchoo
Helloworld
-Block
-Adminhtml
Helloworld.php
-Controller
-Adminhtml
-Index
-Index.php
-etc
-module.xml
-adminhtml
-menu.xml
-routes.xml
-view
-adminhtml
-layout
-helloworld_index_index.xml
-templates
-helloworld.phtml
-registration.php
hi rishabh, i corrected the structure like updated in the question but still not working.
– Vivek Xavier
Jan 17 '18 at 8:11
add a comment |
First correct your folder structure name, Like
Inchoo
Helloworld
-Block
-Adminhtml
Helloworld.php
-Controller
-Adminhtml
-Index
-Index.php
-etc
-module.xml
-adminhtml
-menu.xml
-routes.xml
-view
-adminhtml
-layout
-helloworld_index_index.xml
-templates
-helloworld.phtml
-registration.php
hi rishabh, i corrected the structure like updated in the question but still not working.
– Vivek Xavier
Jan 17 '18 at 8:11
add a comment |
First correct your folder structure name, Like
Inchoo
Helloworld
-Block
-Adminhtml
Helloworld.php
-Controller
-Adminhtml
-Index
-Index.php
-etc
-module.xml
-adminhtml
-menu.xml
-routes.xml
-view
-adminhtml
-layout
-helloworld_index_index.xml
-templates
-helloworld.phtml
-registration.php
First correct your folder structure name, Like
Inchoo
Helloworld
-Block
-Adminhtml
Helloworld.php
-Controller
-Adminhtml
-Index
-Index.php
-etc
-module.xml
-adminhtml
-menu.xml
-routes.xml
-view
-adminhtml
-layout
-helloworld_index_index.xml
-templates
-helloworld.phtml
-registration.php
answered Jan 17 '18 at 7:30
Rishabh Rk RaiRishabh Rk Rai
378214
378214
hi rishabh, i corrected the structure like updated in the question but still not working.
– Vivek Xavier
Jan 17 '18 at 8:11
add a comment |
hi rishabh, i corrected the structure like updated in the question but still not working.
– Vivek Xavier
Jan 17 '18 at 8:11
hi rishabh, i corrected the structure like updated in the question but still not working.
– Vivek Xavier
Jan 17 '18 at 8:11
hi rishabh, i corrected the structure like updated in the question but still not working.
– Vivek Xavier
Jan 17 '18 at 8:11
add a comment |
i was also facing the same issue Magento 2.3 CE. I gave the proper permissions for var and pub directories and ran the following commands-
- provided file permission for var/ and pub/
- setup:upgrade
- setup:static-content:deploy -f
- cache:flush
and it started to work.
add a comment |
i was also facing the same issue Magento 2.3 CE. I gave the proper permissions for var and pub directories and ran the following commands-
- provided file permission for var/ and pub/
- setup:upgrade
- setup:static-content:deploy -f
- cache:flush
and it started to work.
add a comment |
i was also facing the same issue Magento 2.3 CE. I gave the proper permissions for var and pub directories and ran the following commands-
- provided file permission for var/ and pub/
- setup:upgrade
- setup:static-content:deploy -f
- cache:flush
and it started to work.
i was also facing the same issue Magento 2.3 CE. I gave the proper permissions for var and pub directories and ran the following commands-
- provided file permission for var/ and pub/
- setup:upgrade
- setup:static-content:deploy -f
- cache:flush
and it started to work.
answered 2 days ago
kaushik kumar roykaushik kumar roy
329
329
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f209739%2fmagento2-sample-custom-admin-module-showing-blank-page%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
have you run deploy and cache flush command from cli
– Bachcha Singh
Jan 17 '18 at 8:43
Hi Bachcha Singh, tried but no luck.
– Vivek Xavier
Jan 17 '18 at 9:27