New community node to render content with templates

Hi people,

Today I fixed several issues with this node.

If you had any problem when installing, please reinstall it again!

3 Likes

Hi community!

I have updated this node with a couple of options:

  • Define the name of the output property.
  • Load templates from public URLs to avoid hardcoding HTML in strings (very useful to organize your templates externally).

Install or update the community node n8n-nodes-document-generator.

You have a sample task to play with the node!

3 Likes

Nice, I will update later. I use the node to build out messages from RSS Feeds.

1 Like

Sorry man, I have downloaded this to test this feature and must have sent you e-mails inintententionaly . The sendmail node has your details in it and did not pay attention at first.

Thank you for having shared this one!

1 Like

No problem @Phonitel :slight_smile:
Enjoy it!

Hello Miquel, what would be the best option to format date using this node? Using handlebars addons is it possible?

Hi @vbarrier

Data must be prepared before using the template.

I recommend you to use the Date Time node.
Format the date as you want. Save it as a new property, and use the generated property in your template.

I hope this helps.

1 Like

Handlebars should be in included by default in the HTML template node…
why n8n doesn’t have a default template language?

2 Likes

Completely agree.

Hello Miquel,
I’m really glad to have found your node but I don’t know how to use it.
I have a set node returning a json before your node but I can’t get #each syntax to work correctly.
Can you help me ?

Thanks a lot

You can map the fields directly, no need for a special node

Either Drag and Drop the field (By dragging from the field name on the left, and drop it in the final destination where you want the template to go)

Or you could type it there directly, in your case that would be

{{$json.prestations.name[0]}}

This would output the first name from the list at index 0


But If you want to output a ā€˜template’ for each prestation, you should add a ā€˜Split’ node instead of the DocumentGenerator node, then in the field name to be split, drag and drop prestations which would split them into individual items, then drag and drop directly from that output into the next node directly