Call Modal of Header also from another Button

How to realize calling / opening a modal that is created within the header also from another part of the website via an URL?

Hello Felix,

Thanks for writing in!

What you have in mind is possible with the help from a JS code. Please do the following:

  • Please edit your header and add a custom my-modal ID to your modal element. You can do this by finding the “Customize” tab in your modal element settings.
  • In your page content, edit it in Cornerstone and insert a button element in the page with # as the href. You must put a custom my-modal-trigger ID to your button.
  • And lastly, in the Cornerstone custom js section, Custom JS and insert the following custom js code
(function($){
  $('#my-modal-trigger').on('click touchstart', function(){
    $('#my-modal-anchor-toggle').trigger('click');
  });
})(jQuery);

We would loved to know if this has work for you. Thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.