Hello,
I have a problem, but I don’t know, "where" it is. This is the situation:
Evolution 1.0.2, eform 1.4.4.6, PHx 2.1.3.
I have an "order" form. This form is partially pre-filled with values that are fetched according to the page where I click the "order" button. I do this with a small snippet I have written. The snippet is called just before generating the form with eform. The ID of the calling document is passed by a GET parameter "m". In that snippet, I set two placeholders, these placeholders are used in my form template (chunk).
Now the problem is: In the form, I only get the value of one of these two placeholders. The other placeholder is empty.
Here is my snippet:
<?php
$maschine = 0+ $_GET['m'];
if($maschine > 0){
$docfield = $modx->getTemplateVarOutput(array('pagetitle','bild'), $maschine, 1);
$titel = $docfield['pagetitle'];
$bild = $docfield['bild'];
if($bild != ""){
$bild = "<img src='" . $bild . "' alt='' width='198'>";
}
else{
$bild = "kein Bild";
}
}
else{
$titel= "Bitte eintragen";
$bild = "";
}
$modx->setPlaceholder('mietBild',$bild);
$modx->setPlaceholder('mietName',$titel);
?>
In my form, I can only output [+mietName+], but not [+mietBild+]. I have already tried anything, I think:
- changed the order of the setPlaceholder statements: no change in behaviour
- changed the name of [+mietBild+] to many other names: no change in behaviour
- deleted the setting of the working [+mietName+], so that only the faulty PH is used: no output, either
- assigned the value $bild to [+mietName+]: the correct IMG tag is output, so it is not a question of retreiving or passing the values
- deactivated the PHx plugin (although I need it), because I found hints that this might cause the problem: no change
- calling the snippet both cached and uncached: no change (the pages are not cached, either)
What can it be and what can I still try? I am quite out of ideas.
Thanks for any ideas
Martin