Text formatting is changed when a website is reloaded

@emmy and all…

The previous thread…:

If I format a text element #TitleText with the following line and call up the live page, everything is displayed correctly. But when I reload the page, the text element is suddenly displayed in bold and some other text elements (not all) on the page (e.g. also in the footer) are also displayed in bold. If I comment out this one line, there are no problems. Is this perhaps a bug in Wix?

$w("#TitleText").html = <p><b>About ${myTitle}<b></p>;

The right expression is in backticks ( ` ), but I had to leave them out here in the editor, otherwise it would not be displayed correctly.

Everything is displayed correctly at first. Only when I call up the website again in the browser do the problems occur. The problems persist until I close the website and reload it. The first time I open the page everything is ok again, but not when I reload it. I also have a rich text box on the page, when the website is called up again the text is then displayed very briefly (< 1 second) in bold and then correctly (tested on two end devices with different browsers).

Brief update:

I was also unable to reproduce the problem with the identical velo-code on a test page.
It is probably a bug in Wix.
I will therefore completely recreate the page and get back to you…

@emmy and all :slight_smile:

I can now reproduce the problem:

If I create a new dynamic page and insert only a single text element (“'TitleText”) and connect it via velo as follows to a dynamic dataset:

	const itemObj = $w("#dynamicDataset").getCurrentItem();
	let myTitle;
	myTitle = itemObj.title
	$w("#TitleText").html = `<p><b>About ${myTitle}<b></p>`;

…several (not all) non-connected text elements in the footer are also affected (and are also output in bold). However, this only happens if I call up the URL directly in the browser. If I call up the URL via a link from another dynamic page, this does not happen.

Hey @Spektral,

It seems that when you’re adding the <b> to the <p> tag, it is overriding your settings for the Paragraph 2 in your theme settings for that page, which is why it’s applying to other texts on the page and not on Dynamic pages.

If you’re using Wix Studio, you can try adding custom CSS that only applies to the specific textbox. Or, you can change your #TitleText to be something other than Paragraph 2, especially if you’re using that in a lot of other places on the site.

1 Like

Hi @emmy,

thanks for your continued help, yes, that’s probably the reason. Since I explicitly assign the html settings only to a dedicated textbox, I think it’s likely a bug in the backend of Wix.

I use Wix Editor (not Studio). Changing the paragraph causes other problems, but since I don’t need any links or similar in the title text box, I defined the desired string beforehand and now simply use $w(“#TitleText”).text", so everything works.

Thanks again & greetings from Germany!

Spektral