Create custom controllers (Advanced feature)
Build custom controllers to use across experiences. Easily connect reusable data, scripts, and events to your page and set up inputs, outputs, and events.
始める前に
Role required: ui_builder_admin
手順
- Navigate to All > Now Experience Framework > UI Builder.
- Select Create.
- Select Controller.
-
On the form, fill in the fields.
表 : 1. Create a page collection form Field Description Name Name to track your controller internally. Description Short description to help find your controller. Write a description that helps page builders understand what content is included in the controller. -
Select Create.
The controller building window opens.
-
Add data resources.
- Select + Add data resource.
- Select a data resource from the list.
- Select Add.
- Configure the data resource.
- Select Save.
- オプション:
Add an external controller dependencies.
- Select + Add external controller dependency.
-
On the form, fill in the fields.
表 : 2. Edit external controller dependency Field Description Name Name to identify your external controller dependency. Label Label to help find your external controller dependency. Controller Select a controller for your external controller dependency. - Select Save.
- オプション:
Add client state parameters.
- Select Client sate parameters.
- Select + Add.
- Enter a unique name for the client state parameter.
- Select the type from the dropdown.
- Enter an initial value in the field.
- Select Save.
For more information about client state parameters, see Client state parameters. - オプション:
Add client scripts.
- Select the + icon next to Client scripts.
- Write your script to perform an action.
- オプション:
Add a Script include or Associated components, which shows up in the
importsparameter of your client script function. - Select Apply.
- Select Save.
次のタスク
Use the custom controller you just created by adding the controller to a page.