In the last article we looked at hiding existing menu items and also adding new sub menu items. In this article we will look at adding our own custom menus and sub menu items within the same framework as before. We will use the same code as last time but build on it slightly. The objective now is to create a new menu at the same level as the “Send To” menu and then add some sub menu items. For this example the sub menu items will simply link to external website addresses. To start with let’s modify the code as shown below:

This code block will add the relevant menus we described above. When you now access the UI the menu items should be shown as below:

We could enhance this slightly further also by adding a simple hierarchy of menu items. In the real world you probably wouldn’t do this as it can be quite complex to use and administer. The code needs to be changed as below:

This will then render as below:

With a little extra JavaScript and a little creativity you can create very complex menu structures with different events that are fired based on the link clicked. The above examples are just some of the things you can do with it. 