Шаблоны
Последнее обновление not available | История страницы | Улучшить эту страницу | Сообщить о проблеме
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$204 per month—let's make that $500!
Learn moreШаблоны¶
Этот документ описывает шаблонизацию сниппета mhPayPal. Обзор пакета: mhPayPal.
Шаблонизация mhPayPal выполняется через tpl-чанки.
formTpl, formTplAnonymous¶
По умолчанию:
<form action="[[+action]]" method="[[+config.method]]" id="mhpp_form_[[+config.id]]">
<p>Your donation will be safely processed by PayPal, allowing you to donate via a PayPal account or directly with a credit card.</p>
[[+errors:notempty=`
<p>Uh oh.. The following error(s) were found in your form: <br />[[+errors]]</p>
`]]
<div>
<label for="mhpp_amount_[[+config.id]]">Amount</label>
<div>
<select name="currency" id="mhpp_currency_[[+config.id]]">
<option value="EUR"[[+currency_EUR:notempty=` selected="selected"`]]>EUR €</option>
<option value="USD"[[+currency_USD:notempty=` selected="selected"`]]>USD $</option>
<option value="GBP"[[+currency_GBP:notempty=` selected="selected"`]]>GBP £</option>
</select>
<input type="text" name="amount" id="mhpp_amount_[[+config.id]]" />
[[+currency.error]] [[+amount.error]]
</div>
</div>
<div>
<div>
<input type="submit" name="[[+config.submitVar]]" value="Donate!" />
</div>
</div>
</form>
Доступные плейсхолдеры
Плейсхолдер [[+name here]] |
Описание |
|---|---|
| config.___ | Значение свойства сниппета, указанного через __. Все свойства см. в [mhPayPal]. |
| action | URL текущей страницы для POST на себя. |
| amount | Введённая сумма (если есть). |
| currency | Выбранная валюта (если есть). |
| currency_CURRENCYKEY | Для выбранной валюты плейсхолдер равен 1, например currency_USD. Удобно для select, как в шаблоне по умолчанию. |
| _____.error | Где _____ это имя поля, содержит ошибку для этого поля. |
| errors | Сбор ошибок в формате fieldname: error, разделённых свойством &errorSeparator. |
Примеры¶
Bring it on..
errorTpl¶
По умолчанию:
<span>[[+error]]</span>
Плейсхолдеры:
Плейсхолдер [[+name here]] |
Описание |
|---|---|
| error | Текст ошибки. |
successTpl¶
По умолчанию:
<div>
<h3>Thanks! You're awesome!</h3>
<p>PayPal says your [[+description]] ([[+currency]] [[+amount]]) transaction is [[+PAYMENTSTATUS]]! You're really cool for helping out on this project further. Do not hesitate to get in touch should you need help!</p>
</div>
Плейсхолдер [[+name here]] |
Описание |
|---|---|
| Any data fields' name | Значение поля данных. |
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$204 per month—let's make that $500!
Learn more










