Sandrine Berthier
Sandrine Berthier

Reputation: 21

Use of ifempty in openTBS docx template

I am trying to use the ifempty attribute in a docx template to choose from 2 available variables. I do not have access to the php files. I am just a user of a system using tbs to allow custom export.

Here are the results of my tests (var.first is empty, var.second contains the word library)

[var.first;ifempty=var.second]

Result : var.second

[var.first;ifempty=[var.second]]

Result : [var.first;ifempty=library]

How do I get just the content of the second variable if the first one is empty ? I hope I am being clear. English is not my mother language...

Thanks in advance for any help you can give.

Upvotes: 1

Views: 119

Answers (1)

Skrol29
Skrol29

Reputation: 5597

Embedded fields are supported only in parameters file, script, if, then, else or when. See manual.

So you cannot used embedded field in parameter ifempty, but you could simply use parameter if/then/else instead :

[var.first;if '[val]'='';then [var.second]]

Upvotes: 1

Related Questions