3

Recently I received client requirements for validation Component fields using Event System. I am facing issue in message with multiple lines.

throw new Exception(“Experience must <br> be greater <br> than 10”);

The <br> tag is not working in the Tridion GUI message.

looking for solutions and ideas.

enter image description here

9

You would have to make CSS updates through a GUI extension besides using the new line (\n) in your exception message.

  • In your event system exception, you will be using the new line like this:

    throw new Exception("Some text before new line.\nSome text after new line.");

  • In the GUI extension, set the CSS white-space property to pre-wrap in the div element of the notification message.

    white-space: pre-wrap;

enter image description here

5

Assuming it's C# .NET, you can try using the Environment.NewLine property from the System namespace. NewLine actually equals \r\n.

String.Format("NewLine: {0}  first line{0}  second line{0}  third line",
                          Environment.NewLine);
0

Did you try xhtml line break

<br/>?

  • I tried and not worked <br/> tag. – Sudhakar Rao yesterday

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.