I am having trouble getting HTML contained in a flow variable to render properly in the new Text View node. If I select the option to use a single flow variable for the whole output, the content renders as formatted HTML. But if I embed the variables by using the $$[“variable-name”] syntax, I only see the raw, unformatted HTML.
I need to use the latter approach because I want to combine multiple HTML snippets into a single view. Is this supposed to be possible? Or do I need to assemble the pieces manually into a single HTML string and load it in the Text View as a single variable?
In this example, I use a component to make it easier to write the html text for demo purposes, but there is nothing special and it is just creating a string.
If this doesn’t give you the pointers you need, and you still cannot get yours working, then please upload a simple example.
btw I wasn’t quite sure what you meant about using a single variable versus multiple variables. As far as I can see, you’d ultimately need a single variable to pass to the Text View config as I’ve done here. Are you anticipating passing multiple variables other than how I’ve done it?
Hi @takbb , what you have done here is is what I described as passing a single variable. What I want to do instead is write my own content into the config of the Text View, in which I insert flow variables amongst the free text, just like what is possible in the old Text Output Widget. As per the Text View documentation, I can do this using a special syntax for the flow variables.
As you can see, the variables are being rendered as plain text rather than HTML.
In the Text Output Widget, I can enter:
$${Shtml_A}$$
Some free text
$${Shtml_B}$$
$${Splain-text}$$
…and as long as I select the HTML option, it renders as formatted text without the tags.
So it looks like I need to compile the whole HTML output as a variable first if I want the Text View to render it that way. Perhaps an HTML option will be added to the Text View in the future, similar to the Text Output widget?
Ah ok, I better understand what you are saying now that I can see the screenshot. When you said ‘embed the variables by using the $$[“variable-name”] syntax’ I thought you meant embedding them using that format within the single flow variable. I now realise you were talking about entering them on the Rich Text Content form.
Unfortunately, I think that entering text directly within config is designed to be content only, rather than formatting, since the formatting on this option is performed by way of the toolbar controls, so any text contained within the flow variables at that point will be treated as text literals to be output rather than html tags.
The documentation for the Text View does say “Note, this node is currently under development. Future versions of the node might have improved or changed functionality.” so perhaps adding the ability to specify “treat a section of text (or all text) as html” might be something to add in the “feedback & ideas” section of the forum?
I have then used the CSS Editor, not to edit CSS but to provide a convenient means for entering the text data that would otherwise have been written in the Text View node:
Thanks for the example. All of this makes me think that the Text Output Widget has been retired too soon! Hopefully the Text View will catch up before too long.