Custom Function Call Editor
Make and use your own function call editors on your own functions.
When you insert a function in Visual Editor, a function call editor window ("Function Properties") normally appears.
Here, you need to set required function parameters and/or can set optional parameters if any.
As C1 CMS is flexible and extensible, you can replace the standard function call editor with your own, custom editor. A good example of the custom function call editor is that used for the Composite.Forms.FormBuilder.Form
function, part of the Composite.Forms.FormBuilder add-on.
There is an API call which will inform C1 CMS that there is a custom editor (see the code sample). The call specifies a function name, a tilde-based relative URL to the handler and width/height of the window to be opened.
To create and use a custom editor for a specific function:
- Create a function call handler. This could be a Web Form or a Razor page.
- Make a call to the API's
RegisterCustomCallEditor
method, specifying the function name, the relative URL to the handler created in Step 1 and the sizes of the editor window.
For Step 2, call RegisterCustomCallEditor
on the application startup. For this, use the ApplicationStartup
attribute on a class, which you can place in ~/App_Code
, and call RegisterCustomCallEditor
in the static OnInitialized
method implemented within this class (see the code sample.
Let's have a look at the sample code that hooks up custom editors to some CMS Functions.