I am developing a new module which will provide access to a custom grid using left sided admin menu. The problem is that I cannot create a custom element in this admin menu.
The module is located under vendor
folder, vendor/test/test-extension
, with the following composer.json
under module root:
{
"name": "test/test-extension",
"description": "test extension magento2",
"type": "magento2-module",
"version": "dev-master",
"autoload": {
"files": [
"registration.php"
],
"psr-4": {
"Test\\TestExtension\\": ""
}
}
}
The module is included in autoload_psr4.php
, being able to run install schema and getting models.
But, I'm not able to create a custom element in admin menu, simply it doesn't appear.
etc/acl.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
<acl>
<resources>
<resource id="Magento_Backend::admin">
<resource id="Test_TestExtension::testextension" title="New Extension" sortOrder="52">
<resource id="Test_TestExtension::testentity" title="Entity" sortOrder="11"/>
</resource>
<resource id="Magento_Backend::stores">
<resource id="Magento_Backend::stores_settings">
<resource id="Magento_Config::config">
<resource id="Test_TestExtension::testextension_config" title="Test Extension"/>
</resource>
</resource>
</resource>
</resource>
</resources>
</acl>
</config>
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="Test_TestExtension::testextension" title="Test extension" module="Test_TestExtension" sortOrder="61" resource="Test_TestExtension::testextension"/>
<add id="Test_TestExtension::testentity" title="Test entity" module="Test_TestExtension" sortOrder="11" action="test_testextension/testentity" resource="Test_TestExtension::testentity" parent="Test_TestExtension::testextension"/>
</menu>
</config>
Any ideas ?