Web Application Events - Fluid Topics - 3.7 - Technical Notes

Integrate Fluid Topics APIs

Product
Fluid Topics
FT_Version
3.7
Category
Technical Notes
language
English
audience
public

A common challenge that arises 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 (within the custom.js file).

The following events are available:

  • ft:pageopening, sent when the user navigates to a new page of the web application.
  • ft:reader:topicsloaded, sent when new topics are loaded on the Reader page.
  • ft:search:resultsloaded, sent when new results are loaded on the Search page.
  • ft:search:noresultsloaded, sent when no results match the user's search criteria.
  • ft:auth:usersignedin, sent when a user logs in.
  • ft:auth:usersignedout, sent when a user logs out.

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
});