In my project I use TinyButStrong / OpenTBS to generate Word documents from templates. First I load a variable like myuser
in the document.
[onload;tplvars;myuser=user]
The document is provided with the required variables, so I can add tags like this where the name is placed on the variable:
Hello [myuser.firstName]!
Also conditional values work fine:
[onshow;block=tbs:p;when [myuser.firstName]='John'] This is a paragraph just for John.
But when I have multiple paragraphs that I want to show/hide, it's not easy to select the correct paragraphs (or change the template and add a paragraph). Is it possible to create blocks that have a 'begin' and 'end' that are shown based on a value? Something like this (pseudocode):
Paragraph 1
[if [myuser.firstName] = 'John']
(insert random number of paragraphs and maybe tables/other stuff here)
[end if]
Paragraph n
I could not find any of this in the TBS/OpenTBS docs. Does someone know a method to do this?
Thanks!
Niels