What Velo code is required to open a Lightbox using a URL stored in a collection? Here’s the code I have tried. When I display the url variable it is blank - no idea why because the URL is in the field referenced (Link). The code and URL are shown below. The if condition on line 17 fails due to URL being blank and not containing the openLightbox parameter of URL).
Product:
Editor X
What are you trying to achieve:
Open Lightbox with code using a URL (with parameters) stored in CMS collection.
What have you already tried:
The attached code.
Additional information:
None
1 Like
Still showing CODE as → PICS ???
You have even an integrated OPTION to show CODE —> as CODE → and not as IMAGE.
3 Likes
Hello!!! MyAARPMedicare @user1812
Here’s a solution:
Create Service Account: Set up a Google Developers Service Account.
Enable Google Play API: Enable the Google Play Developer API in your Google Cloud Project.
Generate JSON Key: Create a new service account key in JSON format and save it on your computer.
Upload Build Manually: Before using fastlane supply, manually upload at least one build (APK or AAB) to the Google Play Store.
Initialize Fastlane: Run fastlane supply init in your project folder after the manual upload.
I hope this will help to resolve your query!!
Best Regards
Carol Grayson
This was my solution - thanks.
import wixWindow from ‘wix-window’;
import wixLocation from ‘wix-location’;
$w.onReady(function () {
$w(“#resourceList”).onItemReady(($item, itemData, index) => {
// Get the URL from the itemData, where ‘Link’ is the field name in your dataset
//console.log(itemData);
let url = itemData.link;
// Set up the onClick event for the button
$item("#linkButton").onClick(() => {
//$w("#text13").text = itemData.Link;
// Check if the URL has the necessary parameter to open the lightbox
if (url && url.includes("openLightbox")) {
// Extract the lightbox name from the URL parameter if available
const params = new URLSearchParams(url.split('?')[1]); // Assumes 'url' contains the full URL with parameters
const lightboxName = params.get('lightboxName'); // Assuming there's a parameter 'lightboxName' that specifies which lightbox to open
// Open the specified lightbox when the button is clicked
if (lightboxName) {
wixWindow.openLightbox(lightboxName).then(() => {
console.log("Lightbox opened successfully");
}).catch((err) => {
console.error("Failed to open lightbox", err);
});
}
}
});
});
});