Action: Display message in modal

Created on 27 January 2024, 11 months ago
Updated 2 April 2024, 9 months ago

It would be great to have an action that would display a message in a modal. Standard warning and error messages are fine. But if we want to be sure we have a user's attention, there is a better chance they will read a message if they have to escape an overlay display.

Would this be out of scope with ECA's approach to actions? If not, would it be something that could be implemented through Core or would it need a plugin provided by a module like Modal or Simple Popup Blocks?

Thanks!

Feature request
Status

Closed: outdated

Version

2.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @goldin
  • 🇩🇪Germany jurgenhaas Gottmadingen

    Action plugins, which is what ECA utilises to make things happen, are mostly built to make existing functionality in Core or contrib modules available. They usually don't implement functionality on their own, they re-use existing functionality, and you can think of an action plugin as making such functionality accessible through the UI, or with ECA or other modules that utilise action plugins.

    Displaying Drupal messages in popup windows sounds like a requirement for the theme. It would not only have to provide the markup to make that possible but also some sort of JavaScript, since building and displaying a popup needs to be done in the client, i.e. in the browser. So, the server side PHP has no means to get a popup in the browser.

    Having said that, if your message appears as a response of a user action in the browser, which is posted to the backend by ajax, there are AjaxCommands in Drupal core that can be sent back to the browser together with the regular server response to the ajax request. Those commands are pretty powerful and some of them even get the browser to show either an alert message or a dialog, either modal or not. With ECA 2.0 we do provide action plugins for those ajax commands, that will allow for really powerful stuff.

    In summary, there are 2 categories:

    • Showing regular message in a popup: that requires extra javascript provided by a module or the theme, that grabs messages on the page an pushing them into a modal
    • Responses to ajax requests can contain commands that get the browser to display modal dialogs, which will be supported by ECA

    Does that make sense?

  • Status changed to Postponed: needs info 10 months ago
  • 🇩🇪Germany jurgenhaas Gottmadingen
  • Status changed to Closed: outdated 9 months ago
  • 🇩🇪Germany jurgenhaas Gottmadingen
Production build 0.71.5 2024