Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • bh 444 posts 1544 karma points
    Nov 06, 2023 @ 13:27
    bh
    0

    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.

  • Søren Kottal 713 posts 4571 karma points MVP 6x c-trib
    Nov 07, 2023 @ 07:38
    Søren Kottal
    1

    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.

  • Chriztian Steinmeier 2800 posts 8791 karma points MVP 8x admin c-trib
    Nov 08, 2023 @ 20:11
    Chriztian Steinmeier
    2

    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

Please Sign in or register to post replies

Write your reply to:

Draft