0

My Custom admin page isn't loading up. I get a blank screen I have taken a look at the similar questions in Magento.StackExchange but none of them did the trick. it works if I put the MAGE_MODE to developer soon as I put it back to production it goes blank page no errors on the console not sure where to see the errors I am using Magento 2.2.10

Index.php work if I put die();

    <?php

namespace Module_Name\Test\Controller\Adminhtml\Test;

use \Magento\Backend\App\Action;

class Index extends Action
{
    public function execute()
    {
        $this->_view->loadLayout();
        $this->_view->getLayout()->initMessages();
        $this->_view->renderLayout();
    }
}

adminhtml/layout test_test_index.xml

    <?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">
   <head>
        <title>Custom title</title>
    </head>
    <body>
        <referenceContainer name="content">
            <uiComponent name="test_test_listing"/>
        </referenceContainer>
    </body>
</page>

di.xml

<?xml version="1.0"?>
<config
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <virtualType name="Module\Name\Model\ResourceModel\Form\Grid\Collection" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
        <arguments>
            <argument name="mainTable" xsi:type="string">module_name_list</argument>
            <argument name="resourceModel" xsi:type="string">Module\name\Model\ResourceModel\Form</argument>
        </arguments>
    </virtualType>
    <type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
        <arguments>
            <argument name="collections" xsi:type="array">
                <item name="test_test_listing_data_source" xsi:type="string">Module\Name\Model\ResourceModel\Form\Grid\Collection</item>
            </argument>
        </arguments>
    </type>
</config>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.