Open Content Area Modal with Card Back Button

Hello,

i want to use the Card Element on a website and want the Back Button to open a content Area Modal. Is there a way to achive this, maybe using a shortcode?

Thanks for the Help :slight_smile:

Hey @friedrich_ww,

Thanks for writing in!

You can link the button of the card element to open up a content area modal. Just do the following:
1.) In your Content Area Modal element, find the “Customize” tab and insert a toggle hash.

2.) And then in your Card element, find the “Back Button” tab and simply insert the Toggle hash as the URL you have added in the Content Area Modal element.

grbjhUGNRU2xqnBS8bMo5A

Hope this helps. Please let us know how it goes.

Works fine. Only problem is that: once I close the modal I can’t open it up again until I reload the page. I think it is because of the manual trigger. It put’s the #… behind the URL and can’t trigger the same modal again.

Hey @friedrich_ww,

I tested the same setup in my local setup and it works as expected and I’m able to open the modal with no issues even though the hash is added to the URL. It could be specific to your setup, maybe a script or third party plugin is preventing the modal to open with hash URLs.

First test for a plugin conflict and see if this resolves the issue, if the issue remains, as a workaround you can add the following code in Cornerstone’s JS section:

jQuery(document).ready(function($){
	$(".x-modal-close, .x-modal-content-inner").click(function() {
		history.pushState({}, null, window.location.href.split('#')[0]);
	})
});

Please note that the code provided above serves as a guide only and is to help you in getting started so implementing it and maintaining the code will be out of our support scope and for further maintenance for new possible versions of the theme that may cause the customization to break, you will need to hire a developer.

Thanks!

1 Like

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