Add a viewport component to your page
Add a viewport component to your page and create a subpage to create separate content on the page.
Avant de commencer
Role required: ui_builder_admin
Procédure
- Navigate to All > Now Experience Framework > UI Builder.
-
Open an experience to work in or create an experience by selecting Create > Experience.
See Configure how users interact with your applications in UI Builder for more information on creating experiences.
-
Open the editor for the page variant that you want to add the viewport to.
If you haven't created a page for your experience, follow the steps to Create a page in UI Builder.
- Select + Add content in the content tree.
- Select a Single column layout.
- Next, select the + icon in the column to open the toolbox.
- Enter viewport in the search box.
-
Select Viewport.
Figure 1. Viewport component - Select the viewport component in the content tree.
-
Select + Add in the configuration panel.
-
Select a page collection from the list or create a collection by selecting + Create collection.
For more information on creating your own page collection, see Create a page collection across multiple UI pages.
-
Select Add.
The page collection displays in the Page collections section of the configuration panel. Only one page of the page collection displays in the staging area.
- Select Save.
-
Locate the viewport ID and route.
You can see the ID and route in the Config panel as shown in the following figure.
-
Add a component to your
page to open the viewport you just added, such as a button component.
For more information, see Add and configure components.
- Select the Events tab in the configuration panel.
-
Select + Add event handler to view the viewport.
-
From Page-level event handlers, select UXF Macroponent Viewport Load Requested.
-
In the viewportElementID
element,
replace the null value with the viewport ID that you located in a previous step.
In this example, it is, "viewport_1".
-
Select Add.
- Select Save.
-
View and test your page by selecting
.