Hello,
I want to connect 3 images in 3 fields of a database collection to a gallery with 3 images? Currently i can connect only one image/field to an image in a gallery and the other pictures in the gallery is blank. I always have 3 images and I don't want to create a new database collections for storing my images again as explained in this post . So is there a simple solution for this? Thanks.
sure
Hi 3shtar!
Please open a new thread, describe the issue and the way to reproduce it and some one from our team will respond soon with a solution for you.
Doron.
Hello there,
i got the following issue
the follwoing image might help
Please help me
thank you in advance
Hi All,
I need help with this issue.
I used this code to populate image, title and description for my image gallery (dynamic page). It works fine for preview mode, but it does not work for my live site.
Note: I have already sync-ed my sandbox and live databases. Database permission, anyone can read.
Wix Support Response:
"Upon reviewing your site, it seems that there is a Permissions Error that causing issues with rendering your content from dataset to your live site. Hence, why it renders fine in preview, but not on the live site. This is due to a conflict within the scripted code." "... we highly recommend using the Wix Code Forum."
$w.onReady(function () { let item = $w("#dynamicDataset").getCurrentItem(); $w("#gallery1").items = [ {src: item.image1, title: item.image_title1, description: item.image_desc1}, {src: item.image2, title: item.image_title2, description: item.image_desc2}, {src: item.image3, title: item.image_title3, description: item.image_desc3}, {src: item.image4, title: item.image_title4, description: item.image_desc4}, {src: item.image5, title: item.image_title5, description: item.image_desc5}, {src: item.image6, title: item.image_title6, description: item.image_desc6} ]; });
Thanks in advance.
Regards,
Ben
The reason that b is working is cause at the time of the imatDataset_onReady the page may not ready yet and the $w('#imatgallery') was not ready yet. So you try to interact with the gallery that is not ready yet.
About your questions:
1. This is not a problematic message. Its just writing you what source you need to open in the dev mode in order to debug your code. You can find instruction on debugging in the following article: https://support.wix.com/en/article/testing-and-debugging-code-with-wix-code
2. The way that the gallery present and number of picture is pre-Define. You can hack it with other type of gallery or using default picture that is in the color of the background. Other option is to create the thumbnail functionality by your self with slide show or other component in the editor.
10x, Erez
Hey
anybody here ?
Hi
here are 2 types of codes (a and b).
"a"- this code not working
export function imatDataset_onReady() { let item = $w('#imatDataset').getCurrentItem(); $w('#imatgallery').items = [ {src: item.s1}, {src: item.s2}, {src: item.s3}, ]; }
"b"- this working
$w.onReady(function imatDataset_onReady() { let item = $w('#imatDataset').getCurrentItem(); $w('#imatgallery').items = [ {src: item.s1}, {src: item.s2}, {src: item.s3}, ]; });
1) First question: In the console on wix on preview i get:
"Loading the code for the Imat (ID) page. To debug this code, open pw18x.js in Developer Tools." --> is this a problem? what does it mean and How can I correct it?
2) second question: for example - >> i want to display in the gallery max. 3 images for each item but not Necessarily/Always 3. So is there a solution for this?
because In some case item has only 2 or 1 image. but when in the database are lass images for any item > gallery shows empty pictures boxes --- and message in console -->" Wix code SDK Warning: The src parameter of item at index 1 that is passed to the items method cannot be set to null or undefined."
> > > (see screen) ________ thanks for all in advance ________
thanks
It is unlikely that your dataset id is 'DATASET'
Click the dataset > properties to find the correct id.
export function DATASET_onReady() {
let item = $w('#dataset1').getCurrentItem();
$w('#gallery1').items = [
{src: item.uploadButton1, description: item.ProfilePicture},
{src: item.uploadButton2, description: item.ProfilePicture2},
{src: item.uploadButton3, description: item.ProfilePicture3},
{src: item.uploadButton4, description: item.ProfilePicture4},
{src: item.uploadButton5, description: item.ProfilePicture5},
{src: item.uploadButton6, description: item.ProfilePicture6},
];
}
not working please help
i tried connecting a gallary to a photo data base. in preview the gallary shows for a very short period and then disappears what could be the problem.
There seems to be something missingfrom this code I found this or coding almost the same yesterday and it was working fine and then something happened and I lost yesterdayswork and all the history
There seems to be something missing from this code I found this or coding almost the same yesterday and it was working fine and then something happened and I lost yesterdays work and all the historyy
export function DATASET_onReady()
{ let item = $w('#DATASET').getCurrentItem();
$w('#GALLERY').items = [
{src: item.FIRST_IMAGE_URL, description: item.FIRST_IMAGE_DESC, title: ..., link: ...}, {src: item.SECOND_IMAGE_URL, description: item.SECOND_IMAGE_DESC, title: ..., link: ...}, {src: item.THIRD_IMAGE_URL, description: item.THIRD_IMAGE_DESC, title: ..., link: ...} ]; }
Hay Emerson,
First, best is to ask as a new question and add more details so we can help you better.
Second, if your images are in different fields in the database, have a look at my answer above (the first answer). The code snippet, with little adjustments as described there will do the job.
Can anyone help me. I am creating and REAL ESTATE website and i am trying to link images to a gallery to display the property photos. Can anyone give me a step by step of what i need to do to achieve this please.
Thanks Ido. Its all gone way over my head but thank you for your help.
Hi Robyn,
Try printing the values of item.yourWorkProducts1, item.yourWorkProducts2, item.yourWorkProducts3 by using console.log to see if you retrieve the correct values:
export function Profile_onReady() { let item = $w('#Profile').getCurrentItem(); console.log(item.yourWorkProducts1) console.log(item.yourWorkProducts2) console.log(item.yourWorkProducts3) }
Hi thanks for your help:)
In the console on wix on preview i get:
Loading the code for the Profile (All) page. To debug this code, open eg04h.js in Developer Tools.
In chrome developer tools console i get this:
Failed to load resource: the server responded with a status of 504 (GATEWAY_TIMEOUT)
settings_sync Failed to load resource: the server responded with a status of 504 (GATEWAY_TIMEOUT)
Thank you very much for your help
Hi,
See how to interact with the console here
Thanks Ido - Sorry complete newbie.
Where do I see these?
If it's in the area at the bottom where the code goes. There are no errors before or when in preview.
Hi,
Can you share your console errors, if any ?
Hi Im trying to do this as well.
Doesnt bring the images in. Not sure what im doing wrong.
// For full API documentation, including code examples, visit http://wix.to/94BuAAs
export function Profile_onReady() {
let item = $w('#Profile').getCurrentItem();
$w('#membergallery').items = [
{src: item.yourWorkProducts1},
{src: item.yourWokProducts2},
{src: item.yourWorkProducts3}
];
}
Thank you so much if anyone can help.