Custom Views
Cschoenfeld (Talk | contribs) m (information about trailing slash for uri) |
m |
||
(One intermediate revision by one user not shown) | |||
Line 1: | Line 1: | ||
+ | [[Category:Extending OpenCms]] | ||
+ | |||
A custom view in OpenCms can be very helpful to implement your extensions to OpenCms if adding your own custom [[Adding Admin Tools|Admin Tools]] is not enough. | A custom view in OpenCms can be very helpful to implement your extensions to OpenCms if adding your own custom [[Adding Admin Tools|Admin Tools]] is not enough. | ||
Line 14: | Line 16: | ||
<uri>/system/workplace/YourFolder<span style="color:red;font-weight:bold;">/</span></uri> | <uri>/system/workplace/YourFolder<span style="color:red;font-weight:bold;">/</span></uri> | ||
<name>YourViewName (may be a resource bundle key)</name> | <name>YourViewName (may be a resource bundle key)</name> | ||
− | <helptext>Default help text which will appear (may be a resource bundle key)</ | + | <helptext>Default help text which will appear (may be a resource bundle key)</helptext> |
</root> | </root> | ||
Make sure you have a slash at the end of <em>uri</em>. | Make sure you have a slash at the end of <em>uri</em>. | ||
To make your changes affect the view menu, publish the Offline project and restart OpenCms. | To make your changes affect the view menu, publish the Offline project and restart OpenCms. |
Latest revision as of 13:56, 13 November 2007
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.