【问题标题】:Use of ifempty in openTBS docx template在 openTBS docx 模板中使用 ifempty
【发布时间】:2021-08-26 07:58:03
【问题描述】:

我正在尝试使用 docx 模板中的 ifempty 属性从 2 个可用变量中进行选择。我无权访问 php 文件。我只是使用 tbs 允许自定义导出的系统的用户。

这是我的测试结果(var.first 为空,var.second 包含词库)

[var.first;ifempty=var.second]

结果:var.second

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

结果:[var.first;ifempty=library]

如果第一个变量为空,我如何仅获取第二个变量的内容? 我希望我很清楚。英语不是我的母语...

提前感谢您提供的任何帮助。

【问题讨论】:

    标签: opentbs tinybutstrong


    【解决方案1】:

    仅在参数 filescriptifthenelsewhen 中支持嵌入字段。 见manual

    所以你不能在参数ifempty中使用嵌入字段, 但你可以简单地使用参数if/then/else 代替:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多