top of page

Forum Posts

Jul 02, 2021
In Tips, Tutorials, Examples
Hey guys for those of you stuck with XML data structures that Velo is not supporting to parse, here is a solution: https://github.com/factmaven/xml-to-json This is an API that transforms your XML data into a JSON object. The concept is quite simple, from Wix on a Velo (backend file) write a fetch API query to this URL: On this image, the blue area represents the API URL, and the green area represents the URL provided by a server that is sending an XML response Using fetch you can send a request to the URL https://api.factmaven.com/xml-to-json Make sure to add the ?xml= and your URL to the server that is responding with an XML structure The response back is going to be a JSON object with the content of the XML structure, that you can then parse with JSON.parse() within Velo and use it in whatever way you need such as storing it on a database collection or displaying it on a clientside. IMPORTANT NOTE: Make sure that you write the API on a backend file otherwise you would have a hard time with the CORS policy, blocking the response. Regarding the method in your API simply use GET.
Parsing XML data structures with Velo content media
6
0
519
Mar 28, 2020
In Coding with Velo
I wanted to share this because the first time that I needed to debug the backend I found just a bunch of discussions and URLs to articles but nothing clear/concrete on how to simply console.log() from the backend as you would do when using the developer tools if the browser. You can console.log() your backend extremely easy. Go to your Wix dashboard - settings - site monitoring. There click the "OPEN" button. Once this is ready. Using your live site run it, run from your frontend a promise that calls for a backend function, if the backend function contains a CONSOLE.LOG() this console will be displayed in the site monitoring as a JSON object. this is site monitoring in action: Then click on any of the logs: The jsonPayload contains always your console.log() from the backend. And then keep in mind ALWAYS this message comes in an array, your console.log() is everything but the array. In this case "controller has been called from not submit" is a string that I wrote in my console.log(); as an argument of the log() method.
Console.log() directly from the Backend content media
1
2
2k
Mar 17, 2020
In Coding with Velo
I just wanted to share this recent update to the upload field button used to upload multiple files at the same to post them in a database, until the Corvid team bring a real upload field for more than 1 item. // gallery upload export async function repeaterUploadBtn_change(event) { let imageToGallery = {}; let file = $w('#galleryUploadBtn').value; if(file.length > 0){ const response = await $w('#galleryUploadBtn').startUpload($w('#galleryUploadBtn').buttonLabel = 'Uploading ...'); if(response){ $w('#galleryUploadBtn').buttonLabel = 'Add picture'; imageToGallery.src = response.url; imageToGallery.type = 'image'; console.log('gallery', galleryPictures); galleryPictures.push(imageToGallery); imageToGallery = {}; } } galleryDisplayer(); } function galleryDisplayer(){ $w('#innGallery').items = galleryPictures; $w('#innGallery').expand(); }
5
1
210
Mar 11, 2020
In Coding with Velo
Can anyone advice how to use WixRouterRequest with the ip (this is the documentation https://www.wix.com/corvid/reference/wix-router.WixRouterRequest.html#ip) I feel something is not clear in it yet, the example is only a function with an argument "request" and then in the body of the function is doing request.ip where are we actually using the WixRouterRequest module? I tried to import it but is not in Corvid (editor) Does anyone know how to get the ip number with this WixRouterRequest? I know I can use a third-party API but the whole point is to use this Corvid documentation... I appreciate any help with this, thanks.
WixRouterRequest content media
1
2
63
Oct 17, 2019
In Coding with Velo
Hi guys, I want to program a live radio station widget with Corvid, I could simply use a html5 music player and place it in the URL provided from the streamer. But I was hoping to use the Wix music player when I set the src = ''; and I add the streamer URL it doesn't work. I think this player accepts only prerecorded songs on .mp3 format and some other formats. Note: My streamer URL works fine on any html5 music player My question is, is it possible to build this functionality somehow with Corvid? Thanks! I appreciate any response to it.
1
3
368
Jul 23, 2019
In Coding with Velo
Hello, I'm receiving an error when I check the console in Chrome developer tools. It seems to be referring to a .png file in a gallery container or something like, however I use Wix gallery but is perfect is using only the images that I added to it, I don't use more galleries. I'm not sure where to search for this error to fix it I appreciate any guidance to search for the error in the Wix editor. Thanks!
Error in Chrome developer tools content media
1
4
49

More actions
bottom of page