Sitecore CMS and everything related RSS 2.0
 Friday, May 11, 2007

<!-- HTML EDITOR LINE BREAK
Specifies the tag that the HTML editor inserts on Enter. Values can be
"br", "div" and "p".
-->
<setting name="HtmlEditor.LineBreak" value="br" />

HtmlEditor.LinkBreak is one of those settings you should know about. By default it's set to 'br', which means that every time editor presses Enter in Sitecore Content Editor, a '<br />' tag is inserted.

I think it's wrong - isn't the enter button supposed to start a new paragraph? Changing the setting to "p" gets you there. Shift+enter, on the other hand, does the line break - here goes the <br /> tag.

Here is the difference between two; first, the default br setting:

Paragraph 1 [click enter]
<br />
Paragraph 2 [click enter]
<br />
..

Changing it to p:

<p>Paragraph 1 [click enter]</p>
<p>Paragraph 2 [click enter]</p>

It is semantic html, it feels right and is easier to style, even if you're not concerned with standard compliance. I wonder if there is still a compelling reason to keep having <br /> as a default?

Friday, May 11, 2007 9:48:27 AM (FLE Standard Time, UTC+02:00)  #    Comments [5]
Sitecore
Friday, May 11, 2007 1:15:16 PM (FLE Standard Time, UTC+02:00)
Hi Alexey

Guess I could mail you, but commenting is more fun :-)

There is actually a good reason why <br> is default and it is appearance.

When a user hits the Enter key, they expect a single line feed.

The appearance of a <br> is a single line feed, while <p> appears as a double linefeed, unless a developer has provided a stylesheet class for <p>.

So there you have it.

--Jakob

Jakob
Friday, May 11, 2007 1:36:30 PM (FLE Standard Time, UTC+02:00)
Jakob,

What if we style (in default.css) the p to have one line break in the editor, i.e. a decrease margin a bit?

And for the front end, I would expect most new sites to have styles for paragraphs these days. Perhaps I'm wrong here, but they can always switch back to br. It feels inconsistent that we set XHTML doctype by default, configure XSLTs to output xml but still use the rusty <br /> :-)
Thursday, June 28, 2007 1:52:08 AM (FLE Standard Time, UTC+02:00)
This is great commentary and information. I ran into this problem while training our content editors on how to use the editor. I agree with you on this issue, thus, will make the change to our new Sitecore installation to default to a paragraph instead of a break tag. Thanks!
Tuesday, July 10, 2007 2:24:45 PM (FLE Standard Time, UTC+02:00)
hey!

furthermore on this matter there's a post worth reading about how the RAD editor handles paragraphs, and specifically so how it strips paragraphs if there's just a single one - which could mess with any css having rules set for the paragraph..

you might run into that problem (i know we did), and the only way out of it was to write a custom processor that hooked onto the UISaveHtml pipeline and ensured the existance of a paragraph..

here's a link regarding this behavior on the RAD forum: http://www.telerik.com/community/forums/thread/b311D-ekeab.aspx

i'll shut up now :)

take care!

P.
Peter
Tuesday, July 10, 2007 6:19:41 PM (FLE Standard Time, UTC+02:00)
Peter,

yes, I had the same - but I never thought it was intentional on telerik's part :-/ .. I don't buy this "customers asked for" weird special case. If you want to introduce a hack, at least make a setting or something..
Comments are closed.
Archive
<January 2009>
SunMonTueWedThuFriSat
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567
Blogroll
 Alex de Groot
Few words about SiteCore from Holland
 Alexander Shyba
Sitecore Support
 Anders Dreyer
Anders Dreyer on Sitecore Development
 Jakob Christensen
Sitecore Core Development
 Lars Fløe Nielsen
Lars's ramblings about development and business processes
 Ole Thrane
Sitecore API
 Runi Thomsen
Runi Thomsen Sitecore Toughts
 The Sitecore Experience
The Sitecore Experience
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2009
Alexey Rusakov
Sign In
Statistics
Total Posts: 201
This Year: 0
This Month: 0
This Week: 0
Comments: 0
Themes
Pick a theme:
All Content © 2009, Alexey Rusakov
DasBlog theme 'Business' created by Christoph De Baene (delarou)