Dynamic Function Demo.

Monday, September 25, 2017
Settings:
  • Format: date
  • Style: full
  • Box Schema: box_schema3
Parameters:
  • locale: en_US

Dynamic function demo

Since OpenCms 8.0.2 a new resource "Dynamic Function" is introduced. The new resource type make it possible to drag and drop a dynamic content provided by a jsp directly into a containerpage of the website.

Use Case: A typical use case is extending of the website by a search or a login functionality.

 

Example: In this demo example a simple date display is added to a box, which can be dropped in one of the side containers. The settings are used to set the format of the date. The locale is provided by a request parameter defined for the dynamic function.

 

How to use "Dynamic Function":

  • Drop a new resource of type "Dynamic Function" into the containerpage and edit in xmlcontent editor from ADE.
  • Set the title to indicate this dynamic function from another in the add wizard in ADE.
  • Select the path to the jsp, which provides the required functionality, in the field "Function provider".
  • Add optional request parameters if required in the field "Parameters".
  • Optional formatter configuration for this dynamic function element can be set in the field "Formatter options". You can restrict the type of the container as well as its min or max width to control, in which template container this dynamic function resource can be dropped.

Additionally define the settings in the second tab directly in the xmlcontent editor. Use the same options as inside of the schema definition for the resource type.

Important note: The html output provided by the used jsp should be surrounded by a <div> tag, similar to the formatter jsp.