Perspective button text new line

Hi,
I’m trying to tell Ignition to go to a new line in a Button text but it seems that both the HTML
tag and \n\n don’t work as you can see from my attempts
Perspective button new line 1 Perspective button new line 2
Does anyone know how to do it?
Thanks

oke so

add in the style:

white-space: pre-wrap

and then you will have to fiddle with the text input a bit untill you get this (add in a long string and lose focus):
image

then you can add in enters as you wish:
image

2 Likes

Thanks, initially it didn’t worked because the button text is binded to an expression so I just can’t type directly in the property. But by appliyng the pre-wrap style and incresing a bit the font size it worked out.

you can do it in a script too if you use triple “”"
idk if that works in expressions tho
""" test test test """

It doesn’t seem to work, this is an example of the expression I’m using
if(tag("[default]tagDirectory/tag")=1,'"""line 1 line2"""','"""line1 line2"""')

yeah i thought so
so you can add just the tag in the exprions (or just a direct tag link)
and then use the value in a script transform with the if logic


(seems like you have to remove the tabs tho else it indents)
image

1 Like

Easier option is to use expressions, where the literal \n won't be escaped, e.g.:
"line1\nline2\nline3"
image
(You'll still want the white-space setting applied, though)

3 Likes

setting style white-space to pre-wrap worked for me …thanks

1 Like

yeah it works but only if style attribute whitespace is set to pre-wrap :+1: :+1: