Hey @salilou,
Yes, it is indeed related to the IDs and how the elements are duplicated for the mobile container.
When you duplicate containers or sections to build a separate mobile layout in the Pro Theme, you end up with multiple sliders (and potentially multiple modals) on the same page. When you click an image to open the modal, Cornerstone’s dynamic slide handler (data-x-slide-goto) gets confused because it doesn’t know which slider to target, defaulting to the first one it finds in the page source (which is the hidden desktop version).
To make it work for both desktop and mobile, you need to explicitly link each grid trigger to its respective slider using the data-x-slider-id attribute.
Here is exactly how you can set this up in the Cornerstone builder:
Step 1: Assign Unique IDs to Your Sliders
- Open the builder and select the Slider element inside your Desktop Modal.
- Go to the Customize tab, and in the ID field, enter a unique ID (e.g.,
desktop-slider).
- Select the Slider element inside your Mobile Modal.
- Go to the Customize tab, and in the ID field, enter a unique ID (e.g.,
mobile-slider).
Step 2: Update the Attributes on Your Gallery Grid Triggers
Now, you need to tell each image grid trigger which slider ID to target.
For the Desktop Grid (Looper Consumers / Images):
- Select the image or column element that acts as the click trigger.
- Go to the Customize tab.
- Under Custom Attributes, add a new attribute:
-
Name:
data-x-slider-id
-
Value:
desktop-slider (matching the ID you set in Step 1)
- Keep your existing
data-x-slide-goto attribute set to {{dc:looper:index}}.
For the Mobile Grid (Looper Consumers / Images):
- Select the image or column element that acts as the click trigger in your mobile version.
- Go to the Customize tab.
- Under Custom Attributes, add a new attribute:
-
Name:
data-x-slider-id
-
Value:
mobile-slider (matching the ID you set in Step 1)
- Keep your existing
data-x-slide-goto attribute set to {{dc:looper:index}}.
Step 3: Check Your Modal Hashes (If Modals are Duplicated)
If you duplicated the modal container itself (meaning you have one modal for desktop and one for mobile):
- Make sure they have unique Toggle Hashes (for example,
#galerie-desktop for the desktop modal and #galerie-mobile for the mobile modal).
- Update the link URLs (or the
onclick scripts) on the respective grid triggers to target the correct modal toggle hash.
Once you have saved the changes and cleared your browser/site cache, the mobile layout gallery should correctly talk to the mobile slider, and the desktop gallery will talk to the desktop slider.