SharePoint XSLT and line breaks in multiline plain-text fields

Sometimes I feel like I'm an archaeologist.
This one must be one of the oldest frequently asked question about XSLT and SharePoint. Just Google for "SharePoint xslt line breaks multiline" and what you'll get is a list of sites basically all suggesting the same thing: a custom XSLT template to convert the carriage return to a <br> element.

The question is: is it really the only way to get line breaks for a multiline plain-text field showed in a DFWP?

Don't know about you, but I've always hated XSLT.
So, what's the hidden treasure I've found this time? Here it is:

<SharePoint:FormField runat="server" FieldName="SomeField" ControlMode="Display"></SharePoint:FormField>

And, by the way, it's always been under my very nose (a <SharePoint:FormField> is what is used to render form fields in a custom edit form. The only difference is that the ControlMode is set to Edit).
Not that hidden after all, but still a valuable gem.

1 comment on "SharePoint XSLT and line breaks in multiline plain-text fields"

  1. Thank you very much for the informative article about Digital Agency. We won't tell you we are the best Computer Repair Brisbane CBD, But we assure to help businesses to generate more revenue through IT Support Brisbane


back to top