Creating Custom Functions in Adaptive Forms
In many companies it happens that certain scripts in forms are needed for several forms. Maintaining these scripts individually in all forms costs time and money.
With the help of Custom Functions, these scripts can be managed locally in CRX/DE, i.e. on the server side. However, the scripts are executed on the client side and also loaded as such. The scripts can be dragged and dropped into the rules in the so-called "Rule Editor".
The following steps must be performed to write a custom component script.
1. Preparation
- Creation of the required nodes, directories and files in CRX
- Call the server URL <ServerURL>:<ServerPort>/crx/en
- Create the ClientLibraryFolder. At this point it must be decided which path should be used for this.
In earlier versions, the folder was stored under "/etc/clientlibs".
In current versions, it should be created under "/apps", as shown in the example below.
At eggs, we store the corresponding files in the project directory under "/apps" by default.
Therefore, a directory for the company (eggs) and a directory with the corresponding project (blog) will be created.
Below that the node cq:ClientLibraryFolder is created: