Need to get in pdf specific fields depending on the value of a webform field of one submission. I've tried:

<?php 
$condition == '[webform-tokens:val-fieldname1]';
$conditiontrue == '21';
if($condition == $conditiontrue) : ?>
    [webform-tokens:val-fieldname2]

<?php endif; ?>
    [webform-tokens:val-fieldname3]

But it doesn't work. The field inside php IF condition always printed.
Is it possible to use php IF inside content?

And another question: is it possible to make 2 different templates with different token fields for one webform and to have 2 links for downloading generated pdf files?

Comments

mixael’s picture

I spent a lot of time finding answer. It seems that php code is executed before tokens are applied.
To have 2 different templates for one webform node I've cloned webform2pdf module renaming all files and the data inside code. Now I have two equal modules with two generate pdf options and two download pdf links.