PricingBlog

Line break in text element

  • patrickmast-1275172867587182734

    Patrick Mast

    1 year ago

    If I add a <br> in a text element, the <br> is just displayed without creating a new line. How can I instruct the text in the text element to move to the next line?
    1275172867742502953-image.png
  • lucasg-1275173197657935913

    Lucas G

    1 year ago

    You should be able to just press Enter when entering the text in the box
  • patrickmast-1275371432007831654

    Patrick Mast

    1 year ago

    And how can I do it from a formula?
  • lucasg-1275465344026279936

    Lucas G

    1 year ago

    I'm not sure on your setup or how the data is coming in
  • But a 'simple' one could be to use 2 text nodes
  • I don't know if I would go that route but I haven't ran across this issue 🤔
  • Line breaks happen as normal for me
  • patrickmast-1275485318014832680

    Patrick Mast

    1 year ago

    I have dynamic data that needs to be displayed in one <text> element. How do I add a <br> or <goToNextLine> to it? In HTML its <br>, in other languages its sometimes /n.

    Look at this sample:
    This works great:
    https://files.taxi/patrick/zucCihyd.png

    But, how can we do this in a formula:
    https://files.taxi/patrick/9ZskQTCB.png
  • andreasmoller-1275545578838949939

    Andreas Møller

    1 year ago

    Yeah this is unfortunately not possible atm. A work around I use is to create a variable called line break. You can add a line break as the default value.
  • andreasmoller-1275545907038785556

    Andreas Møller

    1 year ago

    🤦‍♂️
  • patrickmast-1276238052884484228

    Patrick Mast

    1 year ago

    Hey @Andreas Møller, thanks! I'm not 100% understanding your sugested solution. I tries like this but dod not work:
    1276238052632821890-image.png
  • lucasg-1276242358442131467

    Lucas G

    1 year ago

    1276242358219964517-image.png
  • lucasg-1276242402872660081

    Lucas G

    1 year ago

    He meant like an actual line break
  • As in, press Enter for the value of the variable
  • patrickmast-1276382298287243295

    Patrick Mast

    1 year ago

    Ok, now I see! Very very hard to do with dynamic text 😉
    Let say I read a text out of a database that has:
    This is line 1<br>This is line 2
  • max.kayr-1276393047134830595

    Max

    1 year ago

    You could use the replace node to replace all <br> with the content of your variable. This should work
  • patrickmast-1276396482450161664

    Patrick Mast

    1 year ago

    Hey @Max, please try this sample app: https://start-text_on_next_line.toddle.site/
    For testing purpose, it has a variable "Test_Text" that holds the text to display. I tried with "Replace all", but as you can see, the lines are not printed below each other:
  • 1276396493552615486-image.png
  • 892351170402725898-@Patrick Mast
    max.kayr-1276398620748284057

    Max

    1 year ago

    I meant like this 🙂
    1276398620530442331-image.png
  • lucasg-1276400363834179616

    Lucas G

    1 year ago

    If it's that much text you could probably also just use an HTML block
  • patrickmast-1276401539744923648

    Patrick Mast

    1 year ago

    Hey @Lucas G, yes, I tried. But the downside of the HRML block is that it's hard to configure. It only has one global setting for its colors for example.
  • lucasg-1276401665452539915

    Lucas G

    1 year ago

    Ah I see
  • I have my own but if it's a package then yeah I could see it being tough to have a lot of customization
  • patrickmast-1276401841550397471

    Patrick Mast

    1 year ago

    Hey @Max, can you show me whats inside the LINE_BREAK var? I tried the same with a "space" as the contents of the variable LINE_BREAK, but does not work here 🙂
    Normally, this should be oh so much easier 😉
  • lucasg-1276401979102593101

    Lucas G

    1 year ago

    His line break variable is just "Enter"
  • max.kayr-1276402000199815218

    Max

    1 year ago

    This is just "Enter"
  • Ah, @Lucas G was faster again 😉
  • lucasg-1276402128385998909

    Lucas G

    1 year ago

    lol
  • Also, perhaps try cloning the package so you can give it your own configs
  • max.kayr-1276402286872104991

    Max

    1 year ago

    1276402286574440448-image.png
  • patrickmast-1276402403876274230

    Patrick Mast

    1 year ago

    Haha, WORKS!!! Thanks!
    But again.. This should be made simpler for our other Toddle users! 😉
  • max.kayr-1276402616771018752

    Max

    1 year ago

    Agree 🙂
    😎1