cancel
Showing results for 
Search instead for 
Did you mean: 

Customizing Admin Dashboard in Magento

Customizing Admin Dashboard in Magento

I'm trying to add a custom block to the admin dashboard above the "Last Orders" section. I have attempted several approaches, including directly adding the block via layout XML and overriding existing blocks, but none of them seem to be working as expected.

 

Only the following XML snippet works, but it only displays my block at the top or bottom of the dashboard:

<?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">
<body>
<referenceContainer name="content">
<block class="Magento\Backend\Block\Template" name="device_tracking_graph" template="Tra_DeviceTracking::dashboard/device_tracking_graph.phtml" before="-"/>
</referenceContainer>
</body>
</page>
I have tried this but it does not work.
<?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">
    <referenceBlock name="dashboard">
        <block class="Magento\Backend\Block\Template" name="device_track_graph" before="dashboard.lastOrders" template="Tra_DeviceTracking::dashboard/device_tracking_graph.phtml"/>
    </referenceBlock>
</page>

82vCBzZT