[[!FormIt?
&hooks=`spam,email,redirect`
&emailTo=`[[+emailTo]]`
&emailTpl=`formEmail`
&emailSubject=`Contact Form Submission - [[++site_name]]`
&redirectTo=`6`
&validate=`name:required`
]]
<form class="form" action="[[~[[*id]]]]" method="post">
<input name="emailTo" type="hidden" value="[email protected]"/>
<input id="name" name="name" type="text" />
<input type="submit" value="Get your free assessment »" />
</form>
This question has been answered by dave25. See the first response.
[[*id:is=`1`:then=` <!-- homepage stuff --> `:else=` <!-- interior stuff --> <h1>[[*pagetitle]]</h1> [[*content]] `]]
[[*id:is=`1`:then=` [[$homeChunk]] `:else=` <h1>[[*pagetitle]]</h1> `]] [[*content]]
unfortunately that didn't work - so i ended up having to split it into two templates, one that has [[$sidebarFormitCall]] and one that doesn't.
<?php
/*Show contact form snippet */
$docId = $modx->resource->get('id');
if ($docId == 4) {
return $modx->getChunk('nameOfYourChunk');
} else {
return '';
}
<?php
/*Show contact form snippet */
$docId = $modx->resource->get('id');
if ($docId != 8) {
return $modx->getChunk('nameOfYourChunk');
} else {
return '';
}