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?
top of page
Important forum update
This forum is migrating to one unified Wix community forum starting July 26th, and will be read-only during the process.
![feature fixed.png](https://static.wixstatic.com/media/3bfa8a_f845e1016b8a49758acdd6edd6610c3b~mv2.png/v1/crop/x_0,y_2,w_852,h_508/fill/w_104,h_62,al_c,q_85,usm_0.66_1.00_0.01,blur_3,enc_auto/feature%20fixed.png)
Wishlist Page is the official platform for requesting new features. You can vote, comment, and track the status of the requested features.
bottom of page
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)
1) 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
2) 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.
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; } );
Exactly what I needed! Thank you!
This article should help: https://support.wix.com/en/article/how-to-display-calculated-data-from-a-collection