I have create da single row scrollable gallery.
The gallery only has two text fields and I need four.
The gallery Items are being added via code which access a cms collection.
And also adds three text values from the cms fields together forming a single string.
title , timeFrom and timeTo
and then uses that string as the Gallery items description.
var titleAndTime = elem["title"] + " " + elem["timeFrom"] + " - " + elem["timeTo"]
The spaces being in this bit + " " +
This works but I cannot add any spacing between the title and the timeFrom and timeTo parts of the string.
The blank spaces are being stripped and I have not found a way to escape them.
I did try literal entries but that did not work either. The space still got stripped.
function updateGallery() {
wixData.query("Mondays").ascending("timeFrom").find().then(async (res) => {
if (res) {
let info = [];
res.items.map(async (elem) => {
if (elem["title"]) {
var titleAndTime = elem["title"] + " " + elem["timeFrom"] + " - " + elem["timeTo"]
info.push({ "type": "image", "src": elem["image"], "alt": elem["title"], "title": titleAndTime , "description": elem["event"] })
$w("#Monday").items = await info
// set limit of items with // $w("#gallery2").items = await info.slice(0, 5);
}
})
}
})
}
Product:
[Wix Editor
What are you trying to achieve:
I want to space out the concatenated text so it appears like this
Instead of this