Result conditional changed on preview and export

Hi Silverfin,

When previewing a template the result of a conditional changes, and the same happens when we export the template to PDF.

 {% if bezoldiging_zaakvoerder_multiple %}
 {% else %}
 {% endif %}

In the document:

When using “Acties->Voorbeeldweergave”:

In the exported PDF:

I’ve tried changing the condition intro a == true, but this didn’t make any difference.
Furthermore I’ve tried removing all spaces as this was recommended to me for a different problem we had earlier, but to no avail.

With friendly regards,

Hi @Panagiotis_Issaris,

Can you paste the entire code for that part here? The if-statement you pasted looks OK, so this might be related to another part of your code and the use of inputcomments {% ic %}{% endic %}.

Kind regards,

Dear Takis,

If you notice differences in input and export mode, a good first step is to check whether the condition is still met in export mode. Since the variable bezoldiging_zaakvoerder_multiple is only assigned within IC comments, that variable will always be blank in export mode.

{% ic %}
  {% assign bezoldiging_zaakvoerder_multiple = true %}
  {% if custom.ic.bezoldiging_zaakvoerder == "zaakvoerder" %}
    {% assign bezoldiging_zaakvoerder_multiple = false %}
  {% elsif custom.ic.bezoldiging_zaakvoerder == "bestuurder" %}
    {% assign bezoldiging_zaakvoerder_multiple = false %}
  {% elsif custom.ic.bezoldiging_zaakvoerder == "werkend vennoot" %}
    {% assign bezoldiging_zaakvoerder_multiple = false %}
  {% endif %}
{% endic %}



Dear Michiel,

Thanks for the reply! This indeed solved our problem!

I assumed the following statement implied that text was not being output, but the statements were
still being processed (and so variables would be set):

Displaying something in input view and not in export view, can be done with an input comment

With friendly regards,