rich text not a solution for line breaks?

Hi there, I am looking to ensure line breaks in database text for dynamic pages BUT I want to preserve the template font that I set up on the original page. That is, I don’t want to have to create a rich text entry that mimics the text on n + 1 pages just in order to get a line break.

Is there a way to use the normal text box entry and insert the linebreak/carriage return in order to have paragraphs on a dynamic page WITHOUT having to create a rich text entry and copy the format of the target page font into the database for all entries.

I hope I am making this issue clear. If the answer to getting a carriage/return line break in an entry in the database is to use rich text, doesn’t this defeat the purpose of using the database to replicate repeated items and allow the formatting to take place dynamically?

Thanks,

Deborah

6 Likes

Same issue here. Or a way to dynamically modify the formatting of rich text in the page?

Hey,
You can add the text using code and use " /n " to create a new line. Click here to learn more about it.

Best,
Tal.

Hi Deborah, did you ever find a solution to this problem?

I also want to add a line break/paragraph to text blocks delivered from a text field in a collection and cannot seem to make it happen…

Thanks Phil.

No, and in fact I don’t seem to be able to get the point across how needed and useful this would be. If you have hundreds of dynamically generated text items which should really be separated with line breaks or carriage returns, it seems ridiculous to force one to specify formatting within a rich text database column when you do not have the feature of changing the font attributes in the column as a whole. If you come up with a good workaround or solution, please let me know. I am not sure why I can’t properly communicate how limiting this restriction is.

1 Like

@deborah-savage Thanks Deborah. I’ve converted the text field to rich text field and then will manually alter each text field as our database is pretty small. At some point its going to become a bigger issue though and as a solution i don’t like it and agree with you 100%.

Someone said to convert the db field to HTML and style on the dynamic page but I couldn’t see where to do this. Having said that the HTML still needs to be then added to the text…

@deborah-savage Hey Deborah,
What you could do is to create your text in a word processor, convert it to html using any of the many free converters on the web, and then copy paste your html into a text field in your database. Making use of the text themes , you’d be able to retain your preferred font.

Then all you’d have to do is connect your text element to your database using code:

let thisText = $w('#dynamicDataset').getCurrentItem().myText;
$w('#text').html = myText;

@skmedia Hi David, could you explain to what “myText” refers? Thanks!

@misterwanderluster
It is simply the field that you are using in the dataset for your text.
If you don’t use a field at the end of it, then it will get all the data from that row of the dataset.
https://www.wix.com/corvid/reference/wix-dataset.Dataset.html#getCurrentItem

@misterwanderluster Yup, as whisky said, it’s the key to the appropriate column in your collection. This snippet can help you get it:

console.log(Object.keys($w('#dynamicDataset').getCurrentItem())

i want to hyperlink some of my work and it says “to add a link remove a line break” i don’t know what a line break is but i want to hyper link this quickly so get me some answers fast plz.:slightly_smiling_face: