top of page

Forum Posts

Deborah Savage
Mar 25, 2021
In Coding with Velo
Does anyone have a recommended way to send a simple egreeting or ecard from your website. There are a few embed services that may or may not work with wix as add on widgets, but I would just like to create a simple service to allow people to send a free e-greeting from my site using a selected picture and greeting. Would also be interested to know what features need to be built in to prevent spamming. Has anyone successfully integrated an existing widget or built their own and would be willing to discuss? Thank you!
0
0
40
Deborah Savage
Mar 17, 2021
In Coding with Velo
I have a home page where I am calculating the date and pulling images and data to populate something on my header. The code works as expected but before it completes, the images/titles show random content from my database before being overwritten with the expected items. This is very obvious and on the order of seconds on my system. My items are connected to my database set in addition to the code running so I'm not sure if this is some strange race condition. At any rate, I am not clear how to avoid this interim condition. Here's the code I'm using and note that my items are supposedly hidden by default. import wixData from "wix-data"; //next add a check for featured to filter then assign an embed source value and embed the page // add commentary to the page this is probably better than REDISPLAYING $w.onReady(async function () { const today = new Date(); //This line gets todays date. const day = today.getDate() ; //This line gets todays Number day. const month = today.getMonth() + 1 ; //This line gets today's Month $w("#dataset8").onReady(async () => { $w("#dataset8").setFilter(wixData.filter() .eq("month", day) //This line filters the dataset by the Number day -mislabeled .eq("title",month) .ne("hide","yes") .ne("featured","no") ) .then(() => { //You can use this section to do something else after the code finishes filtering //console.log("Dataset is now matching todays day and month."); let file = $w("#dataset8").getCurrentItem(); //console.log("item", file); let tartan = file.tartan; //This line gets the current tartan name let page = file.pageLink; //add condition for undefined send to no tartan page if (!page) { $w('#button28').label = "NO TARTAN YET FOR THIS DATE - COMING SOON!"; } else $w('#button28').link =page; //console.log("page is ", page); //get rid of the header ?? could you set and reset a variable and kill header or back to main page o rjust hide the button alternative just display and redirect ? //$w('#html1').src =page; //console.log("tartan name is", tartan); //"#text52".label =tartan; //$w("#dayOfMonthLabel").label = label; //This line labels our button }) .catch((err) => { //console.log(err); }); }); $w("#dataset6").onReady(async () => { //console.log("month is", month); $w("#dataset6").setFilter(wixData.filter() .eq("month",month) .eq("enabled","yes") ) .then(() => { //You can use this section to do something else after the code finishes filtering //console.log("Dataset is now matching todays day and month."); let newfile = $w("#dataset6").getCurrentItem(); //console.log("item", newfile.title); //console.log("tartan name is", tartan); "#button18".label = newfile.title; "#button18".link = newfile.monthLink; "#button24".label = newfile.featuredSpecial; "#button24".link = newfile.specialLink; }) .catch((err) => { //console.log(err); }); $w('#group23').expand(); $w('#box5').expand(); $w('#button28').expand(); $w('#gallery12').expand(); $w('#gallery11').expand(); }); }); Here's the site, you can definitely see the race condition. Any ideas as to what to do about this would be appreciated. The image and title being picked up originally
My dynamic images show old/random data before loading.  How to avoid this? content media
0
0
17
Deborah Savage
Mar 05, 2021
In Coding with Velo
I have a dynamic page for a category (students) for which I am cycling through using the next previous buttons homework content. Based on some flag fields I am trying to conditionally display or not display items. My current code works only for the first item because I am clearly not running the code on the next/previous updates. How can I cycle through and evaluate each instance. Here's my example based on the the dataset which is a filtered version on the dynamic page (which has already filtered by student). How can I get this to be properly revaluated on the next click. The values don't appear to be consistently evaluated. export function dataset11_ready() { // This function was added from the Properties & Events panel. To learn more, visit http://wix.to/UcBnC-4 // Add your code for this event here: var enableaud = $w('#dataset11').getCurrentItem().audioenabled; var enablevid = $w('#dataset11').getCurrentItem().videoEnabled; var enableprint = $w('#dataset11').getCurrentItem().printenabled; if (!enableaud) { $w('#group1').hide(); $w('#text95').hide(); } console.log("enable print is", enableprint); if (!enableprint) { console.log("enable print is", enableprint); $w('#image43').hide(); $w('#text94').hide(); } //console.log("video enabled",itemData.videoEnabled); if (enablevid === "no") { $w('#image44').hide(); $w('#text96').hide(); } } export function button10_click(event) { dataset11_ready(); // This function was added from the Properties & Events panel. To learn more, visit http://wix.to/UcBnC-4 // Add your code for this event here: } export function button9_click(event) { // This function was added from the Properties & Events panel. To learn more, visit http://wix.to/UcBnC-4 // Add your code for this event here: dataset11_ready(); }
0
0
24
Deborah Savage
Feb 25, 2021
In Coding with Velo
I have a database that holds information for my young piano students, their assignments etc ... . I would like to allow them to choose a virtual "sticker" image when they complete a piece. Is there a way to show a set of images, allow them to select one, and then cause that image to be assigned into an image field in my database. I don't see a way to display or select images other than "upload". I do not want the user to have to upload anything, just to choose from a set I can already display. What would be the best way to go about: Displaying a set of images, allowing someone to select one somehow, and on that selection trigger, to assign the selected image to the image field in the database. To make things more complicated I want to do this for only a set of of items per students, their completed pieces. So I can envision creating a filtered set of data but would like allow selection for each filtered item in the database. How would I go about refreshing after insertion of the image (assuming one can do this). Any suggestions? Thanks!!
0
1
26
Deborah Savage
Dec 24, 2020
In Coding with Velo
Sorry, because I know this must be easier than I am making it, but I am trying to set a value in a database based on a column with a number. In general, I am trying to set a flag based on the rollover current month which I have represented in a database by number 1-12. I am able to obtain and generate the day of the month and the month, but don't seem to be able to filter and set another value based on that. I am not sure if the problem is having to do with filter by a numeric (so I created text equivalent fields) but I still have problems trying to use functions that all seem to take strings. Here's my code - I've tried a lot of variations, creating text equivalent columns (though I'd rather just search and filter on a number) and for comparison purposes, how do I convert a number to a string. I'm not sure I'm going about any of this the right way. Would very much appreciate some steering. Thank you! import wixData from "wix-data"; var d = new Date(); var Month = (d.getMonth()+1) var Day = (d.getDate()) $w.onReady(function () { var OldMonth = 0; // my modulo function if (Month ===1) OldMonth = 12; else OldMonth = Month - 1; if(Day === 1){ //if the month has rolled over, reset a flag in the database - e.g., set the featured month column as a "yes" and clear the previous month //set Old Month featured column to "" //set New Month featured column to "yes" $w("#dataset10").setFilter(wixData.filter().contains("textmonth", "" + Month)).testfeature = "yes"; $w("#dataset10").setFilter(wixData.filter().contains("textmonth", "" + OldMonth)).testfeature = ""; } });
0
4
151
Deborah Savage
Jun 15, 2020
In Coding with Velo
I'm trying to collapse various elements in a repeater that are not assigned. I don't seem to be able to test the label of one of my buttons - it appears to just be holding the original repeater definition within this code. Since the repeater is "ready" why can't I see the dynamically generated labels? Note that the button label is obtained from a reference dataset access from within my repeater source dataset. That is, within my itemData for my repeater, this button label comes from another reference database if that is any is Here's the code I have been working with which seems to work for testing other repeater elements, but I don't seem to be able to reference and test the button element which is why have been trying to just print out the value. If you could let me know how to print out the value of an instantiated button, perhaps I could make progress. export function repeater1_itemReady($w, itemData, index) { $w("#repeater1").onItemReady(() =>{ //console.log("button 6 value is ", $w('#button6').label); if (!itemData.description) { $w("#text85").collapse(); $w("#box5").collapse(); } Thank you!
0
1
21
Deborah Savage
Jun 07, 2020
In Coding with Velo
Unable to get code to collapse a button based on an undefined link or blank label. Have tried the following variations: if (!$w("#button6").link) { if (!$w("#button6").link === undefined) { if (!$w("#button6").label) { if (!$w("#button6").label === "") { and even putting in some valid text to see if I can trigger anything. Please note that my button label and link is retrieved from another reference database through the repeater but since I'm executing this on an onitemReady I am assuming that the values are available within the repeater. In verbose mode I think I see the correct values in the buttons ... Feel I am missing something fundamental. Would very much appreciate some comments. ==== Here's the code with one of the variations to see if I could trigger the collapse by loading an actual text value. Don't seem to be able to do that either. Argh. $w("#repeater1").onItemReady(() =>{ if (!itemData.description) { $w("#text85").collapse(); $w("#box5").collapse(); } if (!$w("#button6").label === "-") { $w("#button6").collapse(); } if ($w("#button7").label === "-") { $w("#button7").collapse(); } }); //Add your code for this event here: }
0
1
44
Deborah Savage
Jun 06, 2020
In Coding with Velo
I'm one of the many trying to conditionally collapse elements in a repeater on a dynamic page. For some unknown reason, I can't get my function to trigger on the empty text field. My text field is within a container box and if the text element is empty, I would like to collapse both the text and the container box. Note that the code does seems to execute if I try to compare non-blank values to something loaded in the database field (such as comparing "dog" to the same loaded in the database, but I don't seem to have success detecting an empty field???? Have read the various attempts on this subject and have lifted and tried many variations - here is what I have tried in terms of the comparison === undefined === "" === '' Also tried the if (!itemData.description) Here's my code with just one of the variations I've tried: export function repeater1_itemReady($w, itemData, index) { $w("#repeater1").onItemReady(() =>{ if (itemData.description === undefined) { $w("#text85").collapse(); $w("#box5").collapse(); } }); //Add your code for this event here: } Would greatly appreciate it if someone could take a look and explain what I must be missing or why I would see different behavior when I define a string as a non-blank. Deborah
0
5
140
Deborah Savage
Dec 28, 2019
In Coding with Velo
I have a calendar type database with various text and image fields and also two number fields MONTH and DAY which I use to create and display dated content in a kind of static calendar. I would like to reckon the current date and then display one of my items based on the calendar month and day using my MONTH and DAY fields in my database. For example, if it is February 14, I would like to display a repeater type element for all the entries that I have tagged with MONTH = 2 and DAY = 14. Could use some pointers on how to retrieve the information and then pass it to an element. Many thanks for any direction.
0
4
447
Deborah Savage
Dec 23, 2019
In Coding with Velo
Because I have dynamically generated pages which deal with "categories" - for example, a selection of Christmas motifs all shown on one page, is there a way to ensure that I can use an implicit internal sort order of the DB elements and pick up a field for SEO that would better illustrate the contents of the entire page rather than a single element? That is, because I don't have access to my reference databases in the SEO selection, I cannot easily get my meta data which would be preferable for these page SEO descriptions, images etc ... . For example, I have various elements from a DB displayed on the page such as Image of Santa, Description of Santa, other database fields Image of Rudoph, Description of Rudolph, other database fields What I would like to place in the SEO for this page is some sort of generic christmas title and description and image (which I have access to through a reference DB but of course, those are NOT accessible via the SEO selections). Without adding yet another field in the DB and putting the desired information into ALL of them to ensure that the one field is populated for SEO use, IS THERE A WAY TO UNDERSTAND THE internal sort order or to force the sort order in some way such that I could populate and use JUST ONE of my entries in particular to pick my SEO description and image WITHOUT NEEDING TO REPLICATE IN ANOTHER FIELD THIS INFO FOR ALL INSTANCES of my entries. In the same way you use reference DBases for this strategy for your page content, we don't seem to be able to do the same for SEO. Right now, I don't appear to be able to even predict the database entry that will be picked up first for SEO from my dataset - it appears random, or even worse, picked up from some other non-dynamic static gallery on my page. I am trying to understand if there is a way to understand which row entry the SEO selections when you name a field on a dynamically generated page. This problem would be solvable of course, if I could access another database through reference fields where I hold my category information. Has anyone else been able to find a workaround to address this? Deborah
0
2
31
Deborah Savage
Sep 25, 2019
In Coding with Velo
A page on my site seems to have some issues. When I select the page in the pages editor, I see the top of the page as expected. however, if I move the cursor to click on the page or click on the menu editor for the dropdown selections of rename/delete/etc ... the screen whites out and effectively hangs. I don't know if the page has been corrupted somehow or is grabbing infinite resources, but I need to delete it. However, all the methods to select the page cause this behavior. All other pages act as expected. Support has not been of help at this point. I would just like to delete it. Any ideas?
0
1
18
Deborah Savage
Sep 23, 2019
In Coding with Velo
I would like to be able to set the rich text attributes, font and colour for every item in my large database so that it displays as desired on my page. I do not wish to "by hand" change this in every cell in my database. Does anyone have a solution for this? This is all because you can't (as far as I know) just insert a simple character sequence to be interpreted as a break or a newline in a plain text field. If this were possible, I would not need the thing I am requesting because I could utilize the font settings on the dynamic page for regular text. ====== Since my text is a set of paragraphs, I also do not want to use plain text because I have never found a solution to easily insert a break or newline into the a plain text field. Has anyone every come up with an easy solution that allows one to put rich text in the database and have it displayed on a dynamic page in a select font and colour without having to explicitly create this in the database each time. note: changing field types from text to to rich text enables that bug which inserts a bunch of html into your text and forces you to go back and edit ... sheesh. Enquiring Minds
0
0
25
Deborah Savage
Jan 05, 2019
In Coding with Velo
I have dynamically generated pages from one Database (DatabaseA) for which I would like to use SEO information by using a particular field in from a Database A field which is a reference field to Database B. This option is not provided when choosing fields on the SEO page. That is, if my page is generated using a database with Text Field . Image Field Reference Field blah . image . Database B where Database B has Text field Target field I cannot selected the Reference Field from Database A in the SEO options and obtain a particular field e.g. (Target Field) from Database B. The objects and elements on the actual page allow for this, but not in the SEO selection. Anyone have the same issue?
0
1
26
Deborah Savage
Jul 25, 2018
In Coding with Velo
Hi there, Am trying to get up to speed on using page code to perform what should be a pretty easy task I thought, but failing. Any help would be greatly appreciated! *** I am trying to connect a repeater to elements from a dataset that is filtered by a "Date" field that I would like to match today's date. I have so far: 1. Used a call to get the date, formatted it, and assigned it to a textid so I can see what is generated, e.g., "Jul 25". I would then like to filter my dataset to show only those entries which have "Jul 25" in the date field. === Right now my filtering attempts either yield nothing or bizarre matches and I have tried multiple ways on the .contains item I have even tried putting .contains("Date","Jul 25")); and still don't get the expected matches. My database from which the dataset is generated has a text field in which I put date strings of that format. Here's the latest incarnation (which doesn't yield anything). // For full API documentation, including code examples, visit http://wix.to/94BuAAs import wixData from 'wix-data'; $w.onReady(function () { // Gets today's date const today = new Date(); // Sets the property of the text element to be a string representing today's date in the user's local format const options = {     day: "numeric",     month: "short" }; $w("#text36").text = today.toLocaleDateString("en-US",options); $w("#dataset2").setFilter(wixData.filter()         .contains("Date","#text36")); });
0
14
1k
Deborah Savage
Jul 15, 2018
In Coding with Velo
Sorry, but am not a java coder but am trying to do functions based on the calendar date. Have found various codes and snippets, but looking for a way to filter a dataset on a page using for a current date (month and day are important, not year). Have found the onready and filtering code but need an easy way to convert for comparison purposes the only representations I have within my databases of dates. I store dates as text and numbers in fields as follows: Date - a text field Jul 23 MONTH - a number field 7 DAY a number field 23 for this example. ---- I have uploaded code onto the page of interest: let today = new date(); $w("#DAYSOFTHEYEAR").setFilter( wixData.filter() .eq("Date", today) ); console.log(today); But clearly the format returned from date() is not in a good form to compare what I store. But am lost in trying to get an easy way to compare dates as strings or numbers or whatever. Any suggestions for what surely must be a problem solved a million times before? Thank you for any assistance on this. P.S. Also, can't figure out how to print things to the console for debugging. The console.log thing does not show anything.
0
2
1k
Deborah Savage
Apr 14, 2018
In Coding with Velo
Would really like an expert to weigh in on this issue so that I don't have to end up either kludging some solution or hand editing one hundred issues. I don't seem to be able to get a response on this that I comprehend. ----- I would like to (on my dynamic page), generate a text section that has multiple paragraphs - that is, text separated by linefeed/carriage returns. I would like these paragraphs to appear in the font and size and color of my dynamic page. That is, I would like to be able to store in my database cells something like this ... "The quick red fox jumped over the lazy brown dog. The lazy brown dog jumped over the quick red fox." ... and have it appear on my page (with the page's font and color attributes) with the corresponding linefeed and carriage return. Regular database text cells seem to eliminate special characters like this and result in The quick red fox jumped over the lazy brown dog. The lazy brown dog jumped over the quick red fox. ***** Going to rich text necessitates that I hand edit EVERY cell with the desired font/color/size etc ... for every entry which seems to defeat the purpose of dynamically generating a page. The default text of times 15 or proxima 15 in black requires changing. So, for every instance of my dynamic pages, I would have to edit all my text cells and change my font/color/size to keep them consistent. And then of course, if I changed my design, I would have to go in and re-edit them all to match the page. ***** I am trying to understand if: 1. There is some way to set default attributes for a rich text database column to address this type of issue OR preferably, 2. embed some escape character sequence into a normal text cell that gets translated to a real carriage return and line feed when the text is picked up dynamically. **** I have noticed the database occasionally forgets edit changes to column properties and so have lost a lot of work and am exasperated that there is not a way to address this issue. Has anyone else successfully dealt with this problem? Trying to make use of generating many pages with text, but using carriage returns and line feeds? Thank you, Deborah
0
3
1k
Deborah Savage
Mar 23, 2018
In Coding with Velo
I need to dynamically create an https:// URL of images stored within my database. Is there a way to generate an automatic conversion of an image field/column upon insert to another column containing a publicly accessible external URL pointing to that same image? Alternatively, it would be great to have a download option for exporting databases into CSV files changing internal media manager addresses to external ones. I am a novice in js coding, so really don't understand how to achieve this within wix. Even understanding a manual algorithm for generating the appropriate address would be useful (if that is doable and doesn't entail some special mapping).
0
1
309
Deborah Savage
Mar 20, 2018
In Coding with Velo
Hi there, I am looking to ensure line breaks in database text for dynamic pages BUT I want to preserve the template font that I set up on the original page. That is, I don't want to have to create a rich text entry that mimics the text on n + 1 pages just in order to get a line break. Is there a way to use the normal text box entry and insert the linebreak/carriage return in order to have paragraphs on a dynamic page WITHOUT having to create a rich text entry and copy the format of the target page font into the database for all entries. I hope I am making this issue clear. If the answer to getting a carriage/return line break in an entry in the database is to use rich text, doesn't this defeat the purpose of using the database to replicate repeated items and allow the formatting to take place dynamically? Thanks, Deborah
6
10
1k
Deborah Savage
Mar 19, 2018
In Coding with Velo
Wondering if anyone can give me the definitive scoop on the why and if there is a workaround. When posting on facebook, if I reference a wix website page, the correct SEO description is fetched, but the link preview image always defaults to the single site image. Additionally the facebook debugger always complains about: The 'og:image' property should be explicitly provided, even if a value can be inferred from other tags. Not sure if that is relevant. Is there some way to get facebook to pick up the website page images during the link preview as it does for other sites? Is there some way to tag one of the images so that it gets picked up by facebook? I can alter the link previews by uploading my own, but this necessitates an intervention for every link I post. Note that is is NOT an issue for the wix blog entries, which get scraped accurately and pick up the correct image. Any experts out there who can weigh in? Very appreciated, Deborah
0
5
1k
Deborah Savage
Mar 19, 2018
In Coding with Velo
Would appreciate some directions here. I have a database with an image column. I am looking to export this database and have an equivalent column that has the https:// URL of the the image. Would appreciate some direction on how to achieve this within the database unless there is some other obvious conversion. Have not employed code before within this system - though I think I must use the src function, but not sure where to define or how. Thank you! Deborah
0
0
33

Deborah Savage

More actions
bottom of page