Custom Views

From OpenCms Wiki
Jump to: navigation, search


A custom view in OpenCms can be very helpful to implement your extensions to OpenCms if adding your own custom Admin Tools is not enough.

Custom views show up in the view selection drop down at the top of the OpenCms screen. After initial setup there are three existing views: Explorer, Administration, and finally the Workflow view.

The views are determined on OpenCms startup from the contents of the VFS directory /system/workplace/views. If you create your own sub folder there, it will be listed in the view drop down, given that you set the following properties:

  • NavPos - Position of your new view in the drop down. By default, the Explorer view has a NavPos of 10, Administration has 20, and Workflow has 30. You can use any floating point value you like, for example 15 to place your new view between the Explorer and the Administration view.
  • NavText - Title of your view in the drop down. The title can be plain text or a resource bundle key (${key.<keyname>}) and must be available to the resource bundles of OpenCms.
  • default-file - the name of the file (relative to your view folder path) to display when the view is selected

OpenCms automatically creates the administration view from the folder structure and properties in the VFS (/system/workplace/admin). If you want to make use of this for your own new view you need to add a section about it to the tool-managers section of opencms-workplace.xml:

<root>
  <key>YourViewName</key>
  <uri>/system/workplace/YourFolder/</uri>
  <name>YourViewName (may be a resource bundle key)</name>
  <helptext>Default help text which will appear (may be a resource bundle key)</helptext>
</root>

Make sure you have a slash at the end of uri. To make your changes affect the view menu, publish the Offline project and restart OpenCms.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox