Hey on my project I would like to create condition in to my html generator template.
Like this example :
{ #if test }
<h2>Ceci est le titre : {test}</h2>
{ /if }
I saw we can use {{ $if() }} but I don’t think I can’t use it to add html code if the variable exists on my input json
If you have another clean methods, I’m interested ^^
n8n
August 13, 2024, 2:25pm
2
It looks like your topic is missing some important information. Could you provide the following if applicable.
n8n version:
Database (default: SQLite):
n8n EXECUTIONS_PROCESS setting (default: own, main):
Running n8n via (Docker, npm, n8n cloud, desktop app):
Operating system:
either that, or you create a variable beforehand that is either ""
or
" ```
<h2>Ceci est le titre : {test}</h2>
```"
and add the variable to the html
Hey, I’m not sure to understand
bartv
August 14, 2024, 7:51am
5
We do not have a template language like that, but you can solve it with expressions. Here’s one approach:
Here’s a small workflow to test this with. If you disable the ‘Set Title’ node, the <h2>
node won’t show. For more complex situations, you’d probably want to use a code node and solve all this in Javascript.
system
Closed
November 12, 2024, 7:52am
6
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.