Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi, id like to display confirmation in a javascript popup as opposed to redirect to new page to confirm the action. It would be a great feature for this module!
Comments
Comment #1
Nicolas Bouteille CreditAttribution: Nicolas Bouteille commentedI managed to do so using Colorbox Node module. You only need to add the colorbox-node class in hook_preprocess_rules_link and also some data-inner-width data-inner-height if need be...
NB : if you're using 2.0, don't use drupal_attributes()
#2534618: Fatal error when switching from 1.1 to 2.0 when using drupal_attributes in custom code
unfortunately, I just noticed it only worked for rules links attached to Comments. For rules links attached to nodes, after I confirm the deletion inside the colorbox, instead of being redirected to the same page, I arrive at the regular Deletion Confirmation page :(EDIT : this actually works fine. My redirect problem was because I was using rules_link_render() function without mentioning the destination parameter.
Careful though, the destination parameter is actually the "query" parameter which needs to be an array with 'destination' inside like that:
The second option you have is to handle the confirmation yourself by displaying the rules link inside a tooltip that opens on click of a custom link, using Tooltipser. In that case the rules link needs to be normal again...
Comment #2
Nicolas Bouteille CreditAttribution: Nicolas Bouteille commentedfor the tooltip I recommend the great tooltipster plugin
Comment #3
lionguard CreditAttribution: lionguard as a volunteer commentedYou can also check out this sandbox module - it allows the triggering of modal boxes to confirm rules action executions:
https://www.drupal.org/sandbox/cmcintosh/2644004
Comment #4
jweirather CreditAttribution: jweirather commentedThanks for the contribution lionguard! I'll have to check that out.