Is there any way to add a custom block in magento 2 admin dashboard? I have a requirement to add custom table in dashboard. Can anyone help me?

enter image description here

My current magento version 2.2.1


You can try to create a custom module that adds the a block there. Create:





<?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="Custom_Module" setup_version="1.0.0">


<?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">
    <referenceContainer name="content">
        <block class="Magento\Framework\View\Element\Template" name="custom.block" after="-" template="Custom_Module::custom.phtml"/>


    echo 'custom code here';

Don't forget to run:

php bin/magento setup:upgrade

php bin/magento cache:flush

  • 1
    This worked, but instead I used <referenceContainer name="header"> to insert custom block into the admin header area – BENN1TH Sep 22 '18 at 23:28

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.