
$modx->setPlaceholder('title', $title);
$modx->setPlaceholder('titleTag', $titleTag);
$modx->setPlaceholder('preContent', $preContent);
$modx->setPlaceholder('content', $content);
return $modx->getChunk('expandBoxTpl');<div class="expand-box gray-box clear-both">
<[[+titleTag:isnot=``:then=`[[+titleTag]]`:else=`h3`]] class="expander" style="[[+preContent:is=``:then=`margin-bottom:0`]]">[[+title]]</[[+titleTag:isnot=``:then=`[[+titleTag]]`:else=`h3`]]>
[[+preContent]]
<div class="expanded">[[+content]]</div>
</div>[[expandBox? &title=`Box Title` &titleTag=`h4` &preContent=` Some summary content with another snippet inside it [[dbSnippet? &id=`123456`]]. And another one: [[dbSnippet? &id=`456123`]] ` &content=` The main content that's hidden until the box is expanded, also with other snippets inside it: [[dbSnippet? &id=`123456`]]. `]]
This question has been answered by BobRay. See the first response.
$fields = array (
'title' => $title,
'titleTag' => $titleTag,
'preContent' => $preContent,
'content' => $content,
return $modx->getChunk('expandBoxTpl', $fields);[[!dbSnippet? ... ]]
<div class="expand-box gray-box clear-both">
<[[+tag]] class="expander" [[+style]]> [[+title]] </[[+tag]]>
Some summary Content [[!dbSnippet? &id=`123456`]] and another one: [[!dbSnippet? &id=`23456`]]
<div class="expanded">[[+content]]</div>
</div>
/* Your code to set the four variables here */
$fields = array(
'tag' => empty($titleTag)? 'h3' : $titleTag,
'style' => empty($preContent)? 'style="margin-bottom:0" ' : '',
'preContent' => $preContent,
'content' => $content,
'title' => $title,
}
return $modx->getChunk('', $fields);[[+dbSnippet1] ... [[+dbSnippet2]]
&id1=`12345` &id2=132453`
$id1 = $modx->getOption('id1', $scriptProperties);
$id2 = $modx->getOption('id2', $scriptProperties); 'dbSnippet1 => $modx->runSnippet('dbSnippet', array('id' => $id1)),
'dbSnippet2 => $modx->runSnippet('dbSnippet', array('id' => $id2)),