What property editor do y'all use for a header that needs the ability for the user to add a linebreak? My titles often need the ability for the user to Italics part of the title as well.
For these I've always used Rich Text Editors, but as these titles are often headings and get wrapped in H1, H2, H3... I end up having to create a helper function to rip the paragraph tags that come from RTE. It's kinda a pain, and after years of doing it this one way, I'm wondering if I've been missing something obvious. The RTE feels like overkill, but maybe "this is the way." I dunno.
A simple way could be to teach the user simple markdown like *italic* and **bold**, and then use a textarea with only a few lines as the property editor. In your template you can convert the markdown to html, and put it in your desired markup tag (h1, h2, etc.)
Umbraco is bundled with HeyRed.MarkdownSharp which you can use to convert markdown to html.
For the usecase of emphasizing some words, I created a property editor a while ago to do just that, called Mardown Textstring Editor that you can try out.
There's a GitHub repo with more info about how to render the property as well.
You could of course also use that as a starting point for your own, if you need to.
Titles with Linebreaks and/or Italics
What property editor do y'all use for a header that needs the ability for the user to add a linebreak? My titles often need the ability for the user to Italics part of the title as well.
For these I've always used Rich Text Editors, but as these titles are often headings and get wrapped in H1, H2, H3... I end up having to create a helper function to rip the paragraph tags that come from RTE. It's kinda a pain, and after years of doing it this one way, I'm wondering if I've been missing something obvious. The RTE feels like overkill, but maybe "this is the way." I dunno.
A simple way could be to teach the user simple markdown like
*italic*
and**bold**
, and then use a textarea with only a few lines as the property editor. In your template you can convert the markdown to html, and put it in your desired markup tag (h1, h2, etc.)Umbraco is bundled with HeyRed.MarkdownSharp which you can use to convert markdown to html.
Hi bh,
For the usecase of emphasizing some words, I created a property editor a while ago to do just that, called Mardown Textstring Editor that you can try out.
There's a GitHub repo with more info about how to render the property as well.
You could of course also use that as a starting point for your own, if you need to.
/Chriztian
is working on a reply...