Web Application Events - Fluid Topics - 3.4 - Technical Notes

Integrate Fluid Topics APIs

Product
Fluid Topics
Fluid Topics Version
3.4
Category
Technical Notes
Language
English
Target 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.

Fluid Topics v3.4.55 introduces a way 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
});