You can view the source code of this example here:
This example demonstrates how to add a new menu item to the OpenCms explorer's context menu.
The example generates a new main menu item "Greet" with a subitem "Say Hello". Clicking on the sub-item you get an alert message, saying hello.
The visibility of the menu items is as follows:
- For folders the item does not show up
- For multiple resources, the item shows up, but is deactivated
- For a single non-folder resource the item shows up and is active
This is illustrated by the following figures.