It is possible to use JavaScript scripts to modify the content of topics. The scripts run once a topic is loaded.
To do so:
- Open a Topic template.
- Select or add the Topic content component.
- Open the component's Settings.
-
Select Add script.
The Add script window opens.
-
Select New script.
-
Select a
.jsfile from local storage.A preview of the selected script appears. It is possible to change the file name or slug.
These scripts must follow a specific structure. See Script structure.
-
Select Save and add.
The script appears in the component's Settings.
Drag and drop scripts in the sidebar to change the order in which Fluid Topics runs the scripts. The first script in the list runs first.
-
Select Save to apply the scripts.
- The files added to the component are added to the portal's Custom code library. It is only possible to manage the Custom code library through the Fluid Topics API.
- Selecting the Delete button does not delete the file from the Custom code library. It only removes the script from the Topic content. Use the Delete a custom code file web service to delete a script.
The Upload/Download feature does not include Topic content scripts.