Skip to content
OpenCms documentation
OpenCms documentation

Adding a context menu item

This example demonstrates how to add a new menu item to the OpenCms explorer's context menu.

You can view the source code of this example here:

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.

For folders the
For all resources that are no folder, the
For more than one resource, the
When clicking