Active
Project:
Webform2PDF
Version:
7.x-3.x-dev
Component:
Code
Priority:
Major
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
15 Aug 2013 at 02:20 UTC
Updated:
18 Aug 2013 at 19:51 UTC
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
Comment #1
mixael commentedI 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.