I’m not an experienced coder so bare with me, please.
I’m getting these error messages, but I can’t find what it is, and most important, how to fix this. The error appears on dynamic pages.
Does anyone have an idea and could maybe explain it to me?
THANKS!
Your inputed URL is not a STRING.
Solution:
var myNumber = 11
var myURL = String(myNumber)
//---> RESULT = "11" (as STRING)
@russian-dima
I believe the problem is slightly different. Michiel tries to display an image, but in code, he does not provide a valid URL to a (Wix) image in the src property of the image component.
@bymichiel It this is not enough answer “show us the code”.
Ok, you are right. It could be the mentioned scenario.
Hi @giri-zano ,
Like I said, I’m not an experienced coder, so I’m gladly wanting to share the code and also one of the dynamic pages where this error appears .
This is the code:
$w.onReady( function () {
$w( “#dynamicDataset” ).onReady(() => {
$w( “#mainImage” ).fitMode = “fixedWidth” ;
$w( “#image1” ).fitMode = “fixedWidth” ;
$w( “#image2” ).fitMode = “fixedWidth” ;
$w( “#image3” ).fitMode = “fixedWidth” ;
$w( “#image4” ).fitMode = “fixedWidth” ;
$w( “#image5” ).fitMode = “fixedWidth” ;
$w( “#image6” ).fitMode = “fixedWidth” ;
$w( “#image7” ).fitMode = “fixedWidth” ;
$w( “#image8” ).fitMode = “fixedWidth” ;
if ($w( “#dynamicDataset” ).getCurrentItem().YouTube) {
$w( “#stripYouTube” ).expand();
$w( “#columnStrip1” ).expand();
$w( “#columnStrip2” ).expand();
}
if ($w( “#dynamicDataset” ).getCurrentItem().video1) {
$w( “#stripVideo” ).expand();
$w( “#columnStrip1” ).expand();
$w( “#columnStrip3” ).expand();
}
if ($w( “#dynamicDataset” ).getCurrentItem().mainImage) {
$w( “#stripImage” ).expand();
$w( “#columnStrip4” ).expand();
}
if ($w( “#dynamicDataset” ).getCurrentItem().mainImageText) {
$w( “#columnStrip6” ).expand();
}
if ($w( “#dynamicDataset” ).getCurrentItem().image1) {
$w( “#ImageStrip1” ).expand();
$w( “#columnStrip6” ).expand();
}
if ($w( “#dynamicDataset” ).getCurrentItem().image2) {
$w( “#ImageStrip4” ).expand();
$w( “#columnStrip4” ).expand();
}
if ($w( “#dynamicDataset” ).getCurrentItem().image3) {
$w( “#ImageStrip4” ).expand();
$w( “#columnStrip9” ).expand();
}
if ($w( “#dynamicDataset” ).getCurrentItem().image4) {
$w( “#ImageStrip4” ).expand();
$w( “#columnStrip9” ).expand();
}
if ($w( “#dynamicDataset” ).getCurrentItem().image5) {
$w( “#ImageStrip4” ).expand();
$w( “#columnStrip9” ).expand();
}
if ($w( “#dynamicDataset” ).getCurrentItem().image6) {
$w( “#ImageStrip7” ).expand();
$w( “#columnStrip9” ).expand();
}
if ($w( “#dynamicDataset” ).getCurrentItem().image7) {
$w( “#ImageStrip7” ).expand();
$w( “#columnStrip9” ).expand();
}
if ($w( “#dynamicDataset” ).getCurrentItem().image8) {
$w( “#ImageStrip7” ).expand();
$w( “#columnStrip13” ).expand();
}
if ($w( “#dynamicDataset” ).getCurrentItem().textBelowYouTube) {
$w( “#columnStrip2” ).collapse();
}
if ($w( “#dynamicDataset” ).getCurrentItem().textBelowVideo) {
$w( “#columnStrip3” ).collapse();
}
});
});
I know; there are many elements on this page. The idea is that when there’s a video (max. 2) added to the database this will be shown on the page. When my client has no video for one of her projects, and no video is added to the database, there will be no video on the dynamic page. The same for images; she could add several images (max. 8) but when she adds, for example 2 images, the other 4 placeholders will not be shown on the dynamic page.
I hope this information helps, otherwise let me know. THANKS!
@bymichiel
How do look like the corresponding DATABASE of your CODE?
Little screenshot-example?