Templating within texts

Something is missing? Have an idea? Ask for new stuff here.
Post Reply
brunoisa10
Posts: 88
Joined: Sun Jan 27, 2019 7:31 pm
Location: Westende Belgium

Templating within texts

Post by brunoisa10 » Wed Jan 30, 2019 8:33 pm

Please implement other things than + within text .
Example : [colour=blue] toto [\colour]
Same with font , underline and everything you can do.
Bruno 8-)

User avatar
TrianguloY
Posts: 78
Joined: Thu Jan 24, 2019 9:46 am

Re: Templating within texts

Post by TrianguloY » Wed Jan 30, 2019 9:05 pm

You mean on item labels? Basic html is allowed, you can write
<p style="color:blue">toto</p>
and the label will be blue.

brunoisa10
Posts: 88
Joined: Sun Jan 27, 2019 7:31 pm
Location: Westende Belgium

Re: Templating within texts

Post by brunoisa10 » Wed Jan 30, 2019 9:45 pm

On bindings

I'll try what you've set
Bruno 8-)

User avatar
TrianguloY
Posts: 78
Joined: Thu Jan 24, 2019 9:46 am

Re: Templating within texts

Post by TrianguloY » Wed Jan 30, 2019 9:50 pm

But a binding for an item label?
'<p style="color:blue">'+$ll_second+'</p>'

brunoisa10
Posts: 88
Joined: Sun Jan 27, 2019 7:31 pm
Location: Westende Belgium

Re: Templating within texts

Post by brunoisa10 » 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;
Bruno 8-)

User avatar
TrianguloY
Posts: 78
Joined: Thu Jan 24, 2019 9:46 am

Re: Templating within texts

Post by TrianguloY » Wed Jan 30, 2019 10:20 pm

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).

brunoisa10
Posts: 88
Joined: Sun Jan 27, 2019 7:31 pm
Location: Westende Belgium

Re: Templating within texts

Post by brunoisa10 » Wed Jan 30, 2019 10:22 pm

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
Bruno 8-)

brunoisa10
Posts: 88
Joined: Sun Jan 27, 2019 7:31 pm
Location: Westende Belgium

Re: Templating within texts

Post by brunoisa10 » Wed Jan 30, 2019 10:45 pm

But issue if l use +"\n" in my bindings
Bruno 8-)

User avatar
TrianguloY
Posts: 78
Joined: Thu Jan 24, 2019 9:46 am

Re: Templating within texts

Post by TrianguloY » 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)

brunoisa10
Posts: 88
Joined: Sun Jan 27, 2019 7:31 pm
Location: Westende Belgium

Re: Templating within texts

Post by brunoisa10 » Thu Jan 31, 2019 5:50 am

Wow. Thanks
Bruno 8-)

brunoisa10
Posts: 88
Joined: Sun Jan 27, 2019 7:31 pm
Location: Westende Belgium

Re: Templating within texts

Post by brunoisa10 » Thu Jan 31, 2019 1:12 pm

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 :)
Bruno 8-)

brunoisa10
Posts: 88
Joined: Sun Jan 27, 2019 7:31 pm
Location: Westende Belgium

Re: Templating within texts

Post by brunoisa10 » Thu Jan 31, 2019 6:44 pm

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
Bruno 8-)

Post Reply