Showing results for 
Search instead for 
Did you mean: 

Data in custom admin module not showing up

Data in custom admin module not showing up


I have followed exact steps given in the below magento guide link but no data is showing in the custom php page.


Please help 

Magento no data.png



Re: Data in custom admin module not showing up

Hi @neelav_barai,

Can you check your module structure?


    `-- ExampleAdminNewPage
        |-- Controller
        |   |-- Adminhtml
        |       |-- HelloWorld
        |           `-- Index.php
        |-- etc
        |   |-- adminhtml
        |   |   |-- menu.xml
        |   |   `-- routes.xml
        |   `-- module.xml
        |-- view
        |   |-- adminhtml
        |       |-- layout
        |       |    `-- exampleadminnewpage_helloworld_index.xml
        |       `-- templates
        |           `-- helloworld.phtml
        |-- composer.json
        `-- registration.php

Are the layout and template files in the right place?

Did you refreshed cache?

In which mode is your application?

Re: Data in custom admin module not showing up

Hi @Damian Culotta,


Yes the directory structure is correct, I have double checked it.

I have complied megento after completion, i have done any deletion of cache, can it do it like this : 

php -f bin/magento cache:flush

I am running in developer mode.

Below is my complete code:



{"name": "bbc/ProdAdmin",
  "description": "A module that creates a page in the Magento admin area",
  "type": "magento2-module",
  "version": "1.0.0",
  "license": [
  "require": {
    "php": "~5.6.0|7.0.2|7.0.4|~7.0.6"
  "autoload": {
    "files": [ "registration.php" ],
    "psr-4": {
      "BBC\\ProdAdmin\\": ""




<?xml version="1.0"?>
<config xmlns:xsi="" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
  <module name="BBC_ProdAdmin" setup_version="1.0.0">


<?xml version="1.0"?><config xmlns:xsi="" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
      <add id="BBC_ProdAdmin::greetings" title="Prod Admin Panel" translate="title" module="BBC_ProdAdmin" parent="Magento_Backend::content" sortOrder="50" dependsOnModule="BBC_ProdAdmin" resource="BBC_ProdAdmin::greetings"/>
      <add id="BBC_ProdAdmin::greetings_helloworld" title="Admin Access" translate="title" module="BBC_ProdAdmin" parent="BBC_ProdAdmin::greetings" sortOrder="10" dependsOnModule="BBC_ProdAdmin" action="prodadmin/ProdAdminControl" resource="BBC_ProdAdmin::greetings"/>


<?xml version="1.0"?><config xmlns:xsi="" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
  <router id="admin">
      <route id="prodadmin" frontName="prodadmin">
          <module name="BBC_ProdAdmin"/>


<?php namespace BBC\ProdAdmin\Controller\Adminhtml\ProdAdminControl;

  class Index extends \Magento\Backend\App\Action
    * @var \Magento\Framework\View\Result\PageFactory
    protected $resultPageFactory;

     * Constructor
     * @param \Magento\Backend\App\Action\Context $context
     * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory
    public function __construct(
        \Magento\Backend\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $resultPageFactory
    ) {
         $this->resultPageFactory = $resultPageFactory;

     * Load the page defined in view/adminhtml/layout/exampleadminnewpage_helloworld_index.xml
     * @return \Magento\Framework\View\Result\Page
    public function execute()
         return  $resultPage = $this->resultPageFactory->create();


<?xml version="1.0"?><page xmlns:xsi="" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
            Product Admin Access
        <referenceContainer name="content">
            <block class="Magento\Backend\Block\Template" template="BBC_ProdAdmin::AdminAccess.phtml"/>


 <p>Hello World!</p>

And after these steps i get the below screen:Magento no data.png

Re: Data in custom admin module not showing up

You need to create xml file like below namespace,


you have kept name Prodadmin_index.xml file. Please correct filename and clear cache and check,

If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial

Re: Data in custom admin module not showing up

Please check route. Xml file. Route id= [xyzid] and layout file name must start with that id