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,
I am using ctools_automodal to generate the ctools modal popup.
I want to display the modal popup on page load.
Can anyone suggest me how to do this?
Thanks
Comments
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedYou'd probably need to use jQuery ready function and call Drupal.CTools.Modal.show() and then fill in the data you want from the modal. You could also simulate a click on a link that loads a modal via AJAX using jQuery's trigger() method.
Comment #2
jaykainthola CreditAttribution: jaykainthola commented@merlinofchaos
Thanks for your comment. I have explored the Ctools and ajax and resolved the problem.
Comment #3
jaykainthola CreditAttribution: jaykainthola commented@merlinofchaos
Thanks for your comment. I have resolved the issue by using following code.
$('.goals-popup a.ctools-use-modal') is the ctools modal link and I created a new function as.
its working fine for me.
Comment #4
jaykainthola CreditAttribution: jaykainthola commented