I hoping someone can help me figure out how to make a dynamic page tha uses two fields in one text element. In my database collection I have two separate fields, State and Zip. I would like the them to display on the dynamic page as “State, Zip” in one text element so that the width will properly adjust as the state and zip change for each location. Anyone have some experience with this?
This article should help: Velo Tutorial: Calculating and Displaying Collection Data | Help Center | Wix.com
Exactly what I needed! Thank you!
I actually found the above tutorial helpful but a little much for something super simple I wanted to achieve.
Hopefully this helps others wanting to do the same.
I essentially had two fields I wanted to concat together and output on the screen from a dataset of pleas1.
$w.onReady( function () {
$w( “#pleas1” ).onReady(() => {
$w( “#amounttotal” ).text = “” + $w( “#amountdonated” ).text + " / " + $w( “#amountneeded” ).text;
} );
Hi,
I’m working on Editor X for an art gallery, I have two issues when concatenate two fields with this code. (database: artists, exhibitions, artworks, news)
- I try to add a reference field (and potentially multi-reference field in case of a group show with multiple artists). It’s showing the ID and not the content.
Based on my research, I’m supposed to use the function include() but don’t know how to integrate in my actual code.
https://www.wix.com/velo/forum/community-discussion/reference-fields-in-dataset
- When using Date fields, It’s showing the entire data, I’m looking to format it as “Day, Date, Month, Year”?
Here is the code:
$w.onReady( function () {
// Write your JavaScript here
$w( “#repeater1” ).onItemReady( ($item, itemData, index) => {
$item( "#text25" ).text = itemData.title + " " + "–" + " " + itemData.artist;
$item( "#text28" ).text = itemData.dateStart + " " + "–" + " " + itemData.dateEnd;
// Click “Preview” to run your code
} );
} );
Here is the result:
Any help would be really appreciate.