Greetings Gurus.
I built a dataset and placed two rich content elements on my webpage. I can connect the two elements to the dataset easily enough, and it works and looks nice. But I need more control over which data is shown. If my two elements were “rich text” or even “text” elements, I could control it using the following code snippet:
function pageContent() {
$w("#dataGAM").onReady( () => {
$w("#dataGAM").getItems(0, 1)
.then( (result) => {
let items = result.items;
$w("#richContent1").html = items[0].gam1;
$w("#richContent2").html = items[0].gam2;
});
});
}
But the two elements must be “rich content” (as opposed to “rich text” or just “text”), because I also need to control the format more than what even rich text allows. (Modifying the themes just won’t cut it for my purposes.) I would also like to use several item fields to divide up my content. Changing between these fields will be handled by forward and back buttons (already coded and working). But the above starter code snippet won’t populate the “rich content” elements. It seems I can only use the UI.
Is there any way to control the content of a rich content element using Velo code?
Perhaps a modification of the above snippet?
Thank you so much.