Use of formatting codes inside conditions

Is there a way to use formatting codes inside a condition?

For example, how can I make % page break before % to be subject to a condition?

Hi Tomas,

The formatting codes cannot be directly subjected to a condition (but you can always launch a feature request.

However, you can use two different internal snippets to create a similar effect. If you factor our the common parts into yet other internal snippets, then the workaround is fairly easy to implement.

Example:

1. {#contract^value > 5000: @WITH-BREAK | else: @WITHOUT-BREAK}

@WITH-BREAK = 
1. % page break before % Alpha beta

@WITHOUT-BREAK = 
1. Alpha beta

Works perfectly within the content body of the clause, but it seems not to work within the content title (e.g. so as to force the page break before the title rather than before the clause). I am guessing this is intended. Correct?

I had never anticipated such use, but it should be possible. So this qualifies as a bug. I’ll look into it — thanks for reporting!

Hi Tomas,

I have resolved the bug, and updated the server.

The code above will now also work in the content title.

Thank you! Works great. Love the snippets.

Returning back to this discussion, but this time concerning %dotted%.

I would like to make %dotted%, which is used in a table, conditional. I have tried using a snippet but it does not seem to work.

Is there a way to achieve this?

My use case is the following. I would like the dotted line to appear if the user opts for ink signatures. And I would like the dotted line to disappear if the user opts for electronic signatures (instead using, e.g. [SIGNED WITH ELECTRONIC SIGNATURE]. I would like to implement this within the same line of the table due other complexities of the table.

It is not currently possible to make the deviating styling in a paragraph or table cell conditional.

Would it help to make two rows, and have the one or the other show, depending on the row condition?

Another possibility is to use the recently added @merge-tables special function, which is particularly handy for complex tables anyway. You could then, for example, create the bulk of your final table in one table, create a second table with the ink signature, and a third table with the electronic signature, and then merge the first table with either the second or the third using @merge-tables.

Yes, two rows should work. Thanks.