3

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?

2 Answers 2

17

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
0
1

Add bellow code in file /app/code/Training/Test/etc/adminhtml/menu.xml

<?xml version="1.0"?>
    <!--
    /**
     * Copyright © 2015 Ccc. All rights reserved.
     */
    -->
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../app/code/Magento/Backend/etc/menu.xsd">
        <menu>
            <add id="training::base" title="ProductImages" module="Training_Test" sortOrder="50" resource="Training_Test::sample"/>
            <add id="Training_Test::productimages" title="Items" module="Training_Test" sortOrder="10" parent="training::base" action="Training_Test/items/" resource="Training_Test::items"/>
        </menu>
    </config>
7
  • not working its also redirect to dashboard
    – Test
    Commented Jan 20, 2016 at 8:05
  • have you createa admin controller with action?
    – Abdul
    Commented Jan 20, 2016 at 8:09
  • for eg add action="catalog/product_set/"
    – Abdul
    Commented Jan 20, 2016 at 8:12
  • <menu> <add id="training::base" title="ProductImages" module="Training_Test" sortOrder="50" resource="Training_Test::sample"/> <add id="Training_Test::productimages" title="Items" module="Training_Test" sortOrder="10" parent="training::base" action="catalog/product_set/" resource="Training_Test::items"/> </menu>
    – Abdul
    Commented Jan 20, 2016 at 8:14
  • i dont need to create controller because action is "admin/system_config/edit/section/example" this is system configuration link and please check my updated question its about seceret key
    – Test
    Commented Jan 20, 2016 at 8:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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