The implementation of HTML used in HTML Template is not true HTML, you don’t get full HTML functionality. It basically takes the HTML code you enter and maps it into XAML which is used to generate the printer template. If you want better control, I suggest you use Document Printer
and XAML format, it is similar in structure to HTML and there is lots of info about it online.
AFAIK in HTML template format most CSS styles won’t work, so that includes display:none
.
EDIT: Actually many CSS styles work, I just haven’t used HTML templates for quite some time as I prefer XAML for better control. But still not display:none
.
You can find details about Document Printer near the top of this topic:
However most importantly, your conditional statement is incorrect, and this is why it is not working.
You are using a “ternary operator” and it needs to be
[='Condition to test' ? 'Value if True' : 'Value if False']
So this part '{PAYMENT TOTAL}'
is invalud. It needs to return True
or False
, but all you are doing is testing against a string value of {PAYMENT TOTAL}
which will give unexpected results if even work at all.
What you really need is something like this:
[=TN('{PAYMENT TOTAL}') > 0 ? '<tr><td style="font-weight:bold">You paid some money<td></tr>' : '']
TN('{PAYMENT TOTAL}') > 0
is using the TN()
function to convert {PAYMENT TOTAL}
to a number and then we are checking if the number is greater than 0
.