Render widget UI components based on page URI
Pages are containers for widgets and have an associated URL or a URL pattern. A common solution involves rendering widgets based on URL.
The following procedure describes the most common way to use a router to add widget UI components based on page URI.
Make widgets available to the SDK using the setWidget or setWidgetType functions.
To add widget components based on page URL:
-
In your React project, open your
Applicationcomponent then paste the following code block:Noteheader_psandfooter_recare configured to appear on all pages in the CEC. -
Replace widget UI components with your UI components and configure them as widget components with the
setWidgetfunction. -
To clear errors if displayed, replace with your widgets and fix import statements.
-
To test integration, visit various pages and verify that they render widgets according to the CEC.