Jump to main content Jump to doc navigation


This document provides information on the mhPayPal snippet templating. If looking for more information about the mhPayPal package in which the snippet is included, please visit ?[mhPayPal|display/ADDON/mhPayPal] instead.

Templating mhPayPal is done through the use of tpl chunks.

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>
        <p>Uh oh.. The following error(s) were found in your form: <br />[[+errors]]</p>
        <label for="mhpp_amount_[[+config.id]]">Amount</label>
            <select name="currency" id="mhpp_currency_[[+config.id]]">
                <option value="EUR"[[+currency_EUR:notempty=` selected="selected"`]]>EUR &euro;</option>
                <option value="USD"[[+currency_USD:notempty=` selected="selected"`]]>USD &#36;</option>
                <option value="GBP"[[+currency_GBP:notempty=` selected="selected"`]]>GBP &#163;</option>

            <input type="text" name="amount" id="mhpp_amount_[[+config.id]]" />
            [[+currency.error]] [[+amount.error]]

            <input type="submit" name="[[+config.submitVar]]" value="Donate!" />

Available Placeholders

Placeholder [[+name here]] Description
config.___ The value of the snippet property identified with the __. See [mhPayPal] for all snippet properties available.
action An URL to the current page to make sure it posts to itself.
amount The filled in amount (if any).
currency The chosen currency (if any).
currency_CURRENCYKEY The chosen currency key will get this placeholder set to 1, for example currency_USD. This can help with selectboxes like in the default above.
_____.error Where _____ is the name of a field, this placeholder contains an error for it.
errors A collection of errors as fieldname: error, separated by the &errorSeparator property.


Bring it on..





Placeholder [[+name here]] Description
error The error message.



    <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>
Placeholder [[+name here]] Description
Any data fields' name The data fields' value.

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.



$0 per month—let's make that $500!

Learn more