Код сниппета
[!eForm? &formid=`ContactForm` &subject=`[+subject+]` &to=`[(emailsender)]` &ccsender=`1` &tpl=`ContactForm` &report=`ContactFormReport` &invalidClass=`invalidValue` &requiredClass=`requiredValue` &cssStyle=`ContactStyles` &gotoid=`46` &vericode=`1` !]
<table><tr><td>Код таблицы</td></tr></table>
<p class="error"></p>
<form method="post" action="captcha_for_modx_01.html" id="EmailForm" name="EmailForm">
<fieldset>
<h3> Contact Form</h3>
<input name="formid" type="hidden" value="ContactForm" />
<label for="cfName" >Your name:
<input name="name" id="cfName" class="text" type="text" value="" /> </label>
<label for="cfEmail" >Your Email Address:
<input name="email" id="cfEmail" class="text" type="text" value="" /> </label>
<label for="cfRegarding" >Regarding:</label>
<select name="subject" id="cfRegarding" >
<option value="General Inquiries" >General Inquiries</option>
<option value="Press" >Press or Interview Request</option>
<option value="Partnering" >Partnering Opportunities</option>
</select>
<label for="cfMessage" >Message:
<textarea name="message" id="cfMessage" rows="4" cols="20" >
код сниппета

<pre class="php php" style="font-family:monospace;"><ol><li style="font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal; margin:0; padding:0; background:inherit;"> </div></li><li style="font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal; margin:0; padding:0; background:inherit;"><span style="color: #000088;">$results</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$modx</span><span style="color: #339933;">-></span> <span style="color: #004000;">getDocumentChildren</span><span style="color: #009900;">(</span> </div></li><li style="font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal; margin:0; padding:0; background:inherit;"> <span style="color: #000088;">$<a class="autolink_link" href="http://modx.ru/docs/glossary/#id" title="Посмотреть значение термина в глоссарии">id</a></span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;"> // <a class="autolink_link" href="http://modx.ru/docs/glossary/#id" title="Посмотреть значение термина в глоссарии">id</a> родительского документа, а именно документа "Блог"</span></div></li><li style="font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal; margin:0; padding:0; background:inherit;"> <span style="color: #000088;">$active</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// Выбираем только опубликованные документы</span></div></li><li style="font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal; margin:0; padding:0; background:inherit;"> <span style="color: #000088;">$deleted</span> <span style="color: #339933;">=</span> <span style="color:#800080;">0</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// Выбираем только неудаленные документы </span></div></li><li style="font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal; margin:0; padding:0; background:inherit;"> <span style="">'<a class="autolink_link" href="http://modx.ru/docs/glossary/#id" title="Посмотреть значение термина в глоссарии">id</a>, pagetitle, published, introtext, content, menuindex, createdby, createdon, deleted, menutitle'</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// Выбираем поля из БД </span></div></li><li style="font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal; margin:0; padding:0; background:inherit;"> <span style="color: #000088;">$where</span> <span style="color: #339933;">=</span> <span style="">''</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// Дополнительные условия не требуются</span></div></li><li style="font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal; margin:0; padding:0; background:inherit;"> <span style="color: #000088;">$sort</span><span style="color: #339933;">=</span><span style="">'createdon'</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// Сортируем документы по полю createdon, т.е. по дате создания</span></div></li><li style="font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal; margin:0; padding:0; background:inherit;"> <span style="color: #000088;">$dir</span><span style="color: #339933;">=</span><span style="">'DESC'</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// Сортируем документы по убыванию</span></div></li><li style="font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal; margin:0; padding:0; background:inherit;"> <span style="color: #000088;">$limit</span> <span style="color: #339933;">=</span> <span style="">''</span> <span style="color: #666666; font-style: italic;">// Ограничения не устанавливаем (параметр LIMIT в SQL запросе)</span></div></li><li style="font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal; margin:0; padding:0; background:inherit;"><span style="color: #009900;">)</span>;</div></li><li style="font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal; margin:0; padding:0; background:inherit;"> </div></li></ol></pre>
[!eForm? &formid=`ContactForm` &subject=`` &to=`[(emailsender)]` &ccsender=`1` &tpl=`ContactForm` &report=`ContactFormReport` &invalidClass=`invalidValue` &requiredClass=`requiredValue` &cssStyle=`ContactStyles` &gotoid=`46` &vericode=`1` !]