Page 1 of 1

Templating within texts

Posted: Wed Jan 30, 2019 8:33 pm
by brunoisa10
Please implement other things than + within text .
Example : [colour=blue] toto [\colour]
Same with font , underline and everything you can do.

Re: Templating within texts

Posted: Wed Jan 30, 2019 9:05 pm
by TrianguloY
You mean on item labels? Basic html is allowed, you can write
<p style="color:blue">toto</p>
and the label will be blue.

Re: Templating within texts

Posted: Wed Jan 30, 2019 9:45 pm
by brunoisa10
On bindings

I'll try what you've set

Re: Templating within texts

Posted: Wed Jan 30, 2019 9:50 pm
by TrianguloY
But a binding for an item label?
'<p style="color:blue">'+$ll_second+'</p>'

Re: Templating within texts

Posted: Wed Jan 30, 2019 10:14 pm
by brunoisa10
Yes fine like that but not with a variable
AlrmFr = '<p style="color:blue">' + Jour + JourN + MoisF + Heure + '</p>';

return AlrmFr;

Re: Templating within texts

Posted: Wed Jan 30, 2019 10:20 pm
by TrianguloY
brunoisa10 wrote:
Wed Jan 30, 2019 10:14 pm
Yes fine like that but not with a variable
AlrmFr = '<p style="color:blue">' + Jour + JourN + MoisF + Heure + '</p>';

return AlrmFr;
That works for me (when I set that code as the binding label of an item, and with those Jour/Mois/Heure variables defined).

Re: Templating within texts

Posted: Wed Jan 30, 2019 10:22 pm
by brunoisa10
TrianguloY wrote:
Wed Jan 30, 2019 9:50 pm
But a binding for an item label?
'<p style="color:blue">'+$ll_second+'</p>'
My bad.
Works like a charm.

Thanks a bunch

Re: Templating within texts

Posted: Wed Jan 30, 2019 10:45 pm
by brunoisa10
But issue if l use +"\n" in my bindings

Re: Templating within texts

Posted: Wed Jan 30, 2019 10:53 pm
by TrianguloY
Because with html tags, newlines are ignored. Use <br> instead
"<p>blabla<br>blabla</p>"
Also make sure you change the maximum number of lines as needed.
For other questions, just search about html (keep in mind not everything works)

Re: Templating within texts

Posted: Thu Jan 31, 2019 5:50 am
by brunoisa10
Wow. Thanks

Re: Templating within texts

Posted: Thu Jan 31, 2019 1:12 pm
by brunoisa10
TrianguloY wrote:
Wed Jan 30, 2019 10:53 pm
Because with html tags, newlines are ignored. Use <br> instead
"<p>blabla<br>blabla</p>"
Also make sure you change the maximum number of lines as needed.
For other questions, just search about html (keep in mind not everything works)
br is giving many separation lines (seems 3 here)

nvm : Line-height is saving me :)

Re: Templating within texts

Posted: Thu Jan 31, 2019 6:44 pm
by brunoisa10
Thanks a ton @TrianguloY

'<font color="green">' +  $ll_hour24 + '</font>' +'<font color="blue">' + '<br>' +  $ll_minute + '</font>' + '<font color="white" >' + '<br>' + $ll_second +'</font>'
For displaying Hour Min Sec on différents colors and each on a new line