HTML tags in Rich Text field

https://www.genshin360.com/guides/how-to-spend-money-in-genshin-impact

The text boxes are populated from a database collection with the content in a rich text field. I would love to be able to insert an image in the text but if I add tags they dont render but just show as text. Whats the solution here?

Hi,
If you have a premium account - use a custom element .
And assign the data using .setAttribute() .

Thanks for answering. I am new to coding in Wix (although I am a retired developper dating back to ASP classic!) so I need a bit more handholding here. Your idea is to add the custom element and then set its contents to the richtext field content from my article collection in the database. Please lead in the right direction then i can do my own research and try coding this:

  • How can I get the value from the rich text field from the collection that is being used for my specific page instance? I suppose the function will need to read the URL of the page as the identifier and then use that identifier to retrieve the correct row data from my collection.

  • Once I did capture the right content how do I then pass this on to my custom element?

Ok so I am getting into this a bit. Here is my first try:

import wixData from ‘wix-data’ ;
let ReturnText = “start value”

wixData.query( “ZG-HTMLTEST” )
.eq( “title” , “Test1” )
.find()
.then( (results) => {
if (results.items.length > 0 ) {
let ReturnText = results.items[ 0 ];
} else {
let ReturnText = “no result XXX”
}
} )
. catch ( (err) => {
let ReturnText = err;
} );

$w.onReady( function () {
$w( ‘#text249’ ).text = ‘Text from Variable’ ;
$w( ‘#text251’ ).text = ReturnText
});

The ZG-HTMLTEST collection exists and has title with value Test1. How come this is not finding anything. I always get ‘start value’ as a result