Configure an external component
Configure your external component as described in the following paragraphs.
Configuration tab
If you use Vue.js, for a seamless integration, we recommend to develop the script locally, and use the bundle files in the Code tab to load the external component, as shown in this example. In this case, you should leave Resources empty.
Fill out as follows:
-
Enter a Control name (namespace + name):
WarningThe name should be unique on the page.
-
In Config, add any additional parameters for your external component code.
-
If necessary, click Add resource, and add a url to a code library:
WarningIf you are on a production environment, we recommend using minified library versions to reduce load time. You should add one resource only per page.
NoteResources load as part of the external component.
-
To confirm your changes, click Save.
Code tab
-
Add here the code to execute when the external component gets initialized on the page:
NoteThe code depends on the Resources configured.
-
To confirm your changes, click Save.
Template tab
-
Add here the HTML markup to inject into the DOM (document object model) when initializing the external component:
-
To confirm your changes, click Save.
Messages tab
Use the messages to inject translations into your external component. The translations are available through the messages property of the options parameter in your external component code. Translations load based on the translation keys and active UI cultures.
To add a message:
-
Click Add message:
-
Enter the message ID, and click + Add translation:
-
Enter a Translation identifier, or click Choose existing.
-
Enter your translation, and click Create.
-
To confirm your changes, click Save, or Save and close if you want to return to the portal page screen.
Change the display settings
-
To change the display settings, on your external component, click
, and select Settings:
-
Change the settings, and click Save.
Apply further customization
If needed, you can make further changes to the external component by adding custom JSON to the Configuration field, then clicking Save.
For example, you can use JSON to pass a configuration object to your code if you do not want to hard-code it in the external component itself.
The following custom configuration passes the identifier of a search component:
{
"searchIdentifier": "Portal.PageComponent.Assets.search"
}
Doing this lets you reuse the external component bundle on different pages by passing a searchIdentifier
value into the Configuration field.