Sublime Forum

Hide parent menu item in context menu

#1

I’ve used is_visible to hide menu items that aren’t needed. But the problem I’m running into is that the parent menu item is still visible, just without any children. Is there any way to hide the parent item if it has no children?

I have this in my Context.sublime-menu:

{ "caption": "FOS User", "children": { "caption": "Create", "command": "sf_fos_user_create", "id": "fosuserSfFosUserCreate" }, { "caption": "Activate", "command": "sf_fos_user_activate", "id": "fosuserSfFosUserActivate" }, { "caption": "Deactivate", "command": "sf_fos_user_deactivate", "id": "fosuserSfFosUserDeactivate" }, { "caption": "Promote", "command": "sf_fos_user_promote", "id": "fosuserSfFosUserPromote" }, { "caption": "Demote", "command": "sf_fos_user_demote", "id": "fosuserSfFosUserDemote" }, { "caption": "Change Password", "command": "sf_fos_user_change_password", "id": "fosuserSfFosUserChangePassword" } ] }

All the children are gone when the FOS User bundle isn’t available. But the ‘FOS User’ is still there. That’s what I want to get rid of. Thanks for the help!

0 Likes

How to hide parent menu entry using the `is_visible`?
#2
1 Like