Can I add a menu without dropdown in openwrt luci? If yes, How?

Hi, I am new to openwrt and I need some help in adding tab without dropdown, I can do it with dropdown but don't want this dropdown.What should i do?

Don't register sub-nodes, then you'll get a toplevel menu item without dropdown.

Example:

entry({"admin", "test"}, cbi("test"), _("Test entry"))

module("luci.controller.admin.page",package.seeall)

function index()
entry({"admin","content"},template("myapp/sample"),_("Hello"),100).index=true
end

I tried this code but it didn't work.Can you pls tell me if there is any error?

Looks fine to me and works locally. Maybe you forgot to remove /tmp/luci-indexcache to flush the menu cache.

No, I am sure I removed the cache.Tho I'll give it a try once again and see if it's working

Thank you very much for your time and concern I was finally able to do it :smile:..
The code was fine, I made some error in the header file.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.