Newline in Product Description

James Mosquito asked on February 19, 2021 12:43

Hi, I am importing some products into Kentico and trying to insert a newline character. I can do that from the editor which translates fine into the frontend but when I set the property from my service the description is being treated as a single line.

Code example:

SKUTreeNode productPage = MyProductPage;
productPage.DocumentSKUDescription = "Some Text\r\n\r\nSome more text;

Does anyone have any ideas please?

Thanks, James

Correct Answer

James Mosquito answered on February 19, 2021 13:52

I realised you can use html markup in the product description so this is working:

SKUTreeNode productPage = MyProductPage;
productPage.DocumentSKUDescription = "Some Text<br><br>Some more text;
0 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.