Yes this can be done using some velo code, wether the data is in a repeater or a dynamic page.
if you are connected through a dataset, then you can call getCurrentItem function on that dataset, that will return an object with the fields in the current item and then you can use $w or $item (if its a repeater) to select the text element and change its text according to the data.
here is how it looks in a dynamic page (using template literals):
export function dynamicDataset_ready () { let currentItem = $w ( ‘#dynamicDataset’ ). getCurrentItem ();
$w ( ‘#text3’ ). text = This mixtape got curated by ${ currentItem . title } on ${ currentItem . curratorDate } in ${ currentItem . curratorLocation } . ;
}
Thanks, but it’s not working. Or my knowledge to get it working is too low.
I get this
public/pages/llg24.js: 'import' and 'export' may only appear at the top level. (7:1)
5 | // Write your JavaScript here
6 |
> 7 | export function dynamicDataset_ready() {
| ^
8 | let currentItem = $w('#dynamicDataset').getCurrentItem();
9 | $w('#text49').text = `This mixtape got curated by ${currentItem.curatorName} on ${currentItem.curatedText} in ${currentItem.curatedLocation}.`;
10 | }