This article is about adding items to the MODX Manager’s Top Menu in PHP. A MODX menu item is kind of an odd thing. The
modMenu object doesn’t have an
id field (its primary key is the
text field), and it doesn’t have a namespace even though it’s almost always associated with one.
It’s relatively easy to create a menu item in the Manager, where many of the details are handled for you, and you can then export it as part of a transport-package build system with the MyComponent extra. At some point, though, you might need to create a menu item in PHP code. Learn More