Add Configuration Link in Magento Menu

magento2

In my module i am create one system configuration now i want to add that link in menu i am trying this code:

in acl.xml

<resource id="Training_Test::example" title="Example" sortOrder="60">
     <resource id="Training_Test::settings" title="Settings" sortOrder="20" />
</resource>

in add this code menu.xml

<add id="Training_Test::settings" title="Settings" module="Training_Test" sortOrder="30" resource="Training_Test::settings" action="admin/system_config/edit/section/example" parent="Training_Test::example"/>

but using this code its redirect to dashboard

Other link in menu it works fine but configuration link is not working

[EDIT]

When i disable Configuration > admin > security > Add secret key in Urls than it works fine but i dont want to disable Add secret key in Urls.

is there any thing to add for this?

Best Answer

In menu.xml your action is like this

admin/system_config/edit/section/example

you have to small change replace admin with adminhtml

adminhtml/system_config/edit/section/example
Related Topic