Hi all. I’m trying to use a chunk containing a nested chunk for the "&report" parameter for eForm (so I can use the "inner" chunk for both the "report" and the "automessage"). This does not appear to work -- I’m getting "{{inner-chunk-name}}" in the report email.
Is this supposed to work? If not, any suggestions? The form is quite long, so duplicating the chunk contents for both the report and the automessage chunks seems quite bad.
Thanks for any and all replies!
-
☆ A M B ☆
- 24,524 Posts
The chunks used as eForm templates are not parsed (except for the internal eForm placeholder replacement), so snippet or chunk tags in the tpl would not work as expected.
Susan--
Thanks for the reply. Is this snippet still being worked on? If so, is there a "suggestion list" somewhere? I’d love to see the following:
- Extended parsing of template chunks to support nested chunk and snippet calls.
- An ’autosubject’ parameter so that automessages can have their own subject
I’m not quite ready to do development work yet...
I got quite confused by eForms behaviour with {{nestedChunk}} with embedded [+dataValue+] in it.
What I realised was happening was the eForm was being evaluated first and then modx was evaluating the {{nestedChunk}} afterwards. This means that although the nested chunk was included. [+dataValue+] was never set for the nestedChunk part of the template, as the nestedChunk was never seen by eForms.
I have been looking at using a separate clean up call to set placeholders after the eForm is parsed to handle this but this is kind of messy as it is reinventing the wheel. The Following code called in the &eFormOnBeforeFormParse=`someFunction` forces a pre-emptive inclusion of the chunks.
$chunks=Array(’List’,’Chunk’,’Here’);
foreach ($chunks as $chunk) {
$templates[’tpl’]=str_replace("{{{$chunk}}}",$modx->getChunk($chunk)."<!-- $chunk replaced -->",$templates[’tpl’]);
}
This may not work very well but it got me round my problem.
Hope it helps
UnderMine