A common challenge when customizing a Fluid Topics portal is making sure that a preset action occurs at the right time. Triggering the right action at the right time usually depends on waiting until another event is completed.
It is possible to listen to certain events that occur in the Fluid Topics web application directly from a JavaScript environment (in the custom.js
file file).
Incorrectly configuring a tenant's custom.js
file can break the tenant. Antidot cannot be held responsible for any problems that may occur for this reason.
The following events are available:
ft:pageopening
ft:reader:topicsloaded
ft:search:resultsloaded
ft:search:noresultsloaded
ft:auth:usersignedin
ft:auth:usersignedout
ft:analytics:userevents
All are native JavaScript events and should be handled like any other event.
The following line shows how to integrate event listening into the custom.js
file:
document.addEventListener('$EVENT_NAME', function(event){
//Insert your JavaScript code here
});