Creatio lets you use assets in the remote module.
Assets include the following:
- fonts
- icons (*.svg files)
- images (*.png, *.jpg, *.jpeg, *.gif files)
- background images (images connected via the background-image CSS property)
Do not use assets in the remote module in the following situations:
- You do not have access to the source code of the remote module.
- Configuring the module properties via incoming properties is not possible because the developer of the remote module does not provide this capability.
You can use assets in the remote module in other situations. Connect assets either directly (CDN or Base64) or via an incoming property. The asset format depends on the Angular project file where the user adds the asset. If you connect the required asset in the Base64 format, the user can use the remote module without access to the required asset on the Internet. View detailed instructions on how to use the assets below.
You can customize assets connected via an incoming property more flexibly than CDN or Base64 assets connected directly . If incoming properties are provided, interact with them via the CrtInput decorator. In this case, set the property value via an attribute or in the Freedom UI page schema. View an example below.
Use a custom font
You can connect a custom font to a remote module in the following ways:
- CDN or Base64 directly
- CDN or Base64 via the incoming property
To use a custom font in a remote module (CDN):
-
Connect the font in the index.html component file.
- Apply the font.
To use a custom font in a remote module (Base64):
-
Connect the font in the src property of the *.component.scss file.
-
Apply the font in the *.component.html file.
To use a custom font in a remote module (CDN or Base64 via the incoming property):
- Flag the incoming field using the CrtInput decorator.
-
Implement the business logic that installs and loads a custom font.
-
Add the needed configuration object that contains the custom font to the Freedom UI page schema. If the Freedom UI page schema of other component uses the remote module, set up the properties via the component attributes.
Use a custom icon
You can connect a custom icon to a remote module in the following ways:
- CDN or Base64 directly
- CDN or Base64 via the incoming property
To use a custom icon in a remote module (CDN or Base64):
-
Add the DomSanitizer abstract class to the component constructor. Learn more about the DomSanitizer abstract class in the official Angular documentation.
In this case, it can display an error about the unsafe URL address of the custom icon.
-
Add the URL of the needed CDN or Base64 custom icon to the bypassSecurityTrustResourceUrl() method.
-
Connect the icon.
You can connect the icon in the following ways:
- via the <img> tag
- via the <object> tag
To use a custom icon in a remote module (CDN or Base64 via the incoming property):
-
Add the DomSanitizer abstract class to the component constructor.
In this case, can display an error about the unsafe URL address of the custom icon.
- Flag the field that contains the custom icon using the CrtInput decorator.
-
Add the URL of the needed CDN or Base64 custom icon to the bypassSecurityTrustResourceUrl() method in.
-
Connect the icon.
You can connect the icon in the following ways:
- via the <img> tag
- via the <object> tag
-
Add the needed configuration object that contains a custom icon to the Freedom UI page schema. Set up the properties via the component attributes using a wrapper.
Use a custom image
You can connect a custom image to a remote module in the following ways:
- CDN or Base64 directly
- CDN or Base64 via the incoming property
To use a custom image in a remote module (CDN or Base64):
-
Add an image to the imageUrl attribute.
-
Connect the image to the [src] attribute of the <img> tag.
To use a custom image in a remote module (CDN or Base64 via the incoming property):
-
Flag the incoming parameter using the CrtInput decorator.
-
Set the imageUrl property value in the Freedom UI page schema. Creatio lets you set a property value from the page schema and the component wrapper.
Use the attribute that contains the property name to set the Base64 image in the wrapper in .
Use a custom background image
You can connect a custom background image in a remote module in the following ways:
- CDN or Base64 directly
- CDN or Base64 via the incoming property
To use a custom background image in a remote module (CDN or Base64 ):
- Find the needed element after the View model initialization.
-
Connect the background image in the remote module.
To use a custom background image in a remote module (CDN or Base64 via the incoming property):
- Flag the incoming parameter using the CrtInput decorator.
-
Set the CSS style when receiving the incoming parameter value.
-
Specify the background image URL in the Freedom UI page schema.