I am looking into options for customizing the Out-of-the-Box (OOTB) session timeout warning toast message.
Specifically, I’d like to know if there is an easy, supported way to update the UI of this toast. Our goal is to add additional elements, such as custom buttons, to the message.
Could you please advise if this is possible OOTB, or if a custom implementation is required?
One of the ways to change the session timeout warning message is to use ‘Language Override’ OOTB feature. (Control Panel → Configuration → Language Override)
While this doesn’t fully meet your needs for an OOTB method, but might be useful for others. You can customize the toast messages using a Client Extension. In the example attached I’ve used the CSS Client Extension sample, and updated the global.css to customize the toast design.
The built-in toast type values that are supported by Liferay.Util.openToast() are:
success
danger
warning
info <— this is the one to customize for the session timeout.
Then, as @Pooja_Bhambani mentioned, you can use the Language Override workaround to customize the session timeout warning message.
I know we can change wording using language override but I am looking for UI customization for this one entire toast! This toast is coming from frontend-js-web module session.ts(https://github.com/liferay/liferay-portal/blob/master/modules/apps/frontend-js/frontend-js-web/src/main/resources/META-INF/resources/legacy/session.ts#L327) so not sure how to customize it.
– Priyank_GajeraI'll defer this to someone who has more insight on it. However, AFAIK, there is no way to customize the toast beyond changing the message.
– Pooja_Bhambani