Help with text formatting in `template` node with output to `text` node

(OLD dashboard - just to be clear)

This is what I have now.
When: {{time}} Error: {{payload}} id: {{source.id}} type: {{source.type}}

And it goes - via a few nodes - to a text node to be displayed.

But I would like some styles/formating too.

This is a bit bland.
:frowning:

I am open to using/trying the ui_template node.
(how ever it is spelt.)

Been a while since I used either Dashboard but if I remember correctly, you need to change the text node output from {{msg.payload}} to {{{msg.payload}}} to allow AngularJS to treat the input as HTML rather than text. Then you can simply include HTML formatting in your template.

Bad news.

No seeming to work.

[{"id":"f4d7facf9a0eae91","type":"inject","z":"c3ec93b2.f3154","g":"e00b697a44223e03","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"**This** is **a** test","payloadType":"str","x":1080,"y":4750,"wires":[["7a50fe368a22b24a"]]},{"id":"c10d9b53be9818e4","type":"inject","z":"c3ec93b2.f3154","g":"e00b697a44223e03","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Test","payloadType":"str","x":1060,"y":4790,"wires":[["7a50fe368a22b24a"]]},{"id":"7a50fe368a22b24a","type":"junction","z":"c3ec93b2.f3154","g":"e00b697a44223e03","x":1316,"y":4680,"wires":[["2031a14b.2fd91e","e6d3baca.8b0b38"]]},{"id":"e6d3baca.8b0b38","type":"ui_text","z":"c3ec93b2.f3154","g":"e00b697a44223e03","group":"e48399e0.8415c","order":3,"width":"10","height":"4","name":"Flow error","label":"","format":"{{{msg.payload}}}","layout":"row-spread","className":"","style":false,"font":"","fontSize":"","color":"#000000","x":1406,"y":4640,"wires":[]},{"id":"e48399e0.8415c","type":"ui_group","name":"Flow error display","tab":"48f5e285.67a4c4","order":2,"disp":true,"width":"11","collapse":false},{"id":"48f5e285.67a4c4","type":"ui_tab","name":"ALARMS","icon":"mi-notification_important","order":6,"disabled":false,"hidden":false}]

Nothing seen with either inject button.

Change the {{{msg.payload}}} to {{msg.payload}} and things are seen, just not formatted.

The template_ui node is getting tempting to try/use.

:wink:

We assumed that you were giving it html, but it appears you are trying to send it markdown **This** is **a** test). I don't think the old dashboard has any markdown support.

Ok, that explains that.

So would <b> work?

Isn't it easier to try it than ask?

Yeah, and I'm an idiot.

Yes, <b> will work, as long as the ui_text node format is {{{msg.payload}}} (triple braces) and the payload is actually an HTML string rather than markdown. For example, setting msg.payload = "<b>Error:</b> <span style='color:red'>flow stopped</span>" in a function node before the text node will render bold and red. Since the old dashboard has no markdown support, any styling has to be done with inline HTML or CSS classes. If you need more layout control later, the ui_template node lets you write full HTML and bind values with {{msg.payload}} directly.

[Admin edit] Added backticks to stop the text being interpreted as html by the forum.

To all people now.

Something weird is (now) happening.

As is the text node is set to {{{msg.payload}}}

Sending ANYTHING into the node, NOTHING is displayed.

But if I change it to just {{msg.payload}} it all works.

Dashboard 3.6 Older NR. 4.0.9

IGNORE PREVIOUS POST.

Mr Chatgpt and I worked it out.

All working.

I don't really understand what we did.
But it works and I didn't just blindly accept stuff.
Just the constraints are still beyond me.