top of page

Forum Posts

Matthew Dodsworth
May 09, 2020
In Coding with Velo
Please excuse any misunderstandings or assumptions in my post (I'm pretty new to Wix) Whilst I totally understand why some fields within the Store table structure would need to be mandatory (to ensure that the Store code operates correctly), I'm wondering why a store owner does not have permission to add there own fields to Store tables. (More on why I want to do this later). I see that it is possible to include 'Options' (for size, color etc) but as far as I can see these need to be set as an option for each product. If all my products have a choice of size and color then would it not be simpler to add size and color fields to the table so that they can be queried directly ? OK here's my real world scenario.. I sell T-shirts and have mock-ups of each design modelled by both a man and a woman. An entry point to the site would be 'show me mens' or 'show me womans', such that I can filter the dataset of the store gallery to display clothing for only the chosen gender. My instinct tells me to put a Gender field in the store Items table but that's not allowed. Am I missing something really obvious ? Let me know your thoughts. Thanks. Mat
0
1
76
Matthew Dodsworth
May 05, 2020
In Coding with Velo
My database has a Themes table and an Items table such that every Item has a Theme. I'd like to allow the user to choose a Theme from a Gallery which would then navigate to another page with another Gallery displaying all Items with the chosen Theme. I have managed this on a simplistic level by binding the Gallery to the Theme table and displaying an image from a field in the table. What I would really like to do is populate the first 'Theme' Gallery where each Gallery item represents a Theme, but to display random images of Items associated with the given Theme such that each Gallery item presents a mini showcase for Items from that Theme. I hope that makes sense. I have a feeling that perhaps the first Gallery should maybe not be a Gallery at all. I chose a Gallery as I wanted Themes to be presented in a grid (as the number of Themes can vary). Any ideas ?
0
1
220
Matthew Dodsworth
Jan 09, 2019
In Coding with Velo
Basically picking 3 random images from a collection.. How to make it quicker ? export function button1_click(event) { wixData.query("Images") .find() .then( (results) => { let randomNumber1 = Math.floor((Math.random() * results.items.length)); let randomItem1 = results.items[randomNumber1]; $w("#image1").src = randomItem1.image; console.log(randomItem1); let randomNumber2 = Math.floor((Math.random() * results.items.length)); let randomItem2 = results.items[randomNumber2]; $w("#image2").src = randomItem2.image; console.log(randomItem2); let randomNumber3 = Math.floor((Math.random() * results.items.length)); let randomItem3 = results.items[randomNumber3]; $w("#image3").src = randomItem3.image; console.log(randomItem3); }); }
0
1
33
Matthew Dodsworth
Dec 29, 2018
In Coding with Velo
I'm trying grab a random record from a collection and display the image (from a field in the record) in an Image control. The random bit seems to be working ok. I see the path to the image but non of my other fields. export function button1_click(event) { wixData.query("Images") .find() .then( (results) => { let randomNumber = Math.floor((Math.random() * results.items.length)); console.log(randomNumber) let randomItem = results.items[randomNumber]; console.log(randomItem) $w("#image1").src = randomItem.Image; console.log("ok") }); //Add your code for this event here: } Any ideas ?
Image Database Field as Image source content media
0
2
960
Matthew Dodsworth
Dec 17, 2018
In Coding with Velo
I have a database, to simplify let's say there is a category Field and an Item field. I want to select x number of Items randomly for a given Category. Additionally I have a flag called Wildcard. When Wildcard is True I need x-1 random Items for the current Category and one random Item for any Category. Easily done with .net, but no idea where to start with Wix ! Any ideas ?
0
1
20

Matthew Dodsworth

More actions
bottom of page