Templates

Template Functions

__

Translation language string. See Translations.

availableStripeElementsFormPaymentMethods

Recieve a list of available Stripe Elements payment methods that need a form. The payment methods returned are filtered for the country and currency that is being displayed. They also need to be enabled in the Stripe account under Apps & Integrations > Payments..

You would use this instead of availableStripeElementsFormPaymentMethods() if you were looking to filter out payment methods like payment-request (Apple Pay) which are displayed before the name and address form is displayed to the user.

Example
{% set pms = availableStripeElementsFormPaymentMethods() %}

availableStripeElementsPaymentMethods

Recieve a list of available Stripe Elements payment methods. The payment methods returned are filtered for the country and currency that is being displayed. They also need to be enabled in the Stripe account under Apps & Integrations > Payments.

Example
{% set pms = availableStripeElementsPaymentMethods() %}

campaign_value

Include campaign value. See Campaign Values.

currency

Get the currency that Dijon Platform has decided to use as the default for the user.

Example
{% set currency = currency() %}

currencySymbol

Get the symbol for the currency that Dijon Platform has decided to use as the default for the user.

Example
{% set symbol = currencySymbol() %}

donation_amounts

Get donation amounts as JSON. See Donation Amounts.

Example
{{ donation_amounts('one_off') }}

donation_amounts_render

Render donation amounts as HTML. See Donation Amounts.

Example
{{ donation_amounts_render('one_off', 'components/donation_amounts.html', 2) }}

editing

Returns if the template is being displayed in the WYSIWYG Editor.

Example
{% set editing = editing() %}

editing_data

Returns editing data that is required to edit hero images in the WYSIWYG Editor.

Example
{% set imagePaths = getHeroImageUrl('hero-background') %}

<img class="bg-image" {{ editing_data('hero-background') }} src="{{ imagePaths.orig }}"
    srcset="{{ imagePaths.w360 }} 360w,
    {{ imagePaths.w480 }} 480w,
    {{ imagePaths.w720 }} 720w,
  {{ imagePaths.w1080 }} 1080w,
  {{ imagePaths.orig }} 2400w">

editing_info

Used to manage editing data for WYSIWYG in a central location. The element attribute based methods will be removed in favour of this method in future versions of Dijon Platform.

Example
window.dijon = { editingData: {{ editing_info()|json_encode()|raw }}};

form

Initialise Javascript Form API. See Form API.

getHeroImageUrl

Get Hero Image data See Images

includeAppCss

Include app.css if we are displaying a page to a normal site visitor or edit.css if we are in the WYSIWYG editor.

Example
{{ includeAppCss() }}

includeAppJavascript

Include app.js if we are displaying a page to a normal site visitor or edit.js if we are in the WYSIWYG editor.

Example
{{ includeAppJavascript() }}

includeCss

Include a CSS file by name.

Example
{{ includeCss('my.css') }}

includeJavascript

Include a Javascript file by name.

Example
{{ includeJavascript('my.js') }}

live_currencies

Get the (almost) live currency conversion that Dijon Platform has. It optionally accepts a name for the Javascript variable it generates, otherwise returns the data with live_currencies as the variable name.

Example
{{ live_currencies('currency_data') | raw }}

managedStyles

Managed styles outputs our managed styles as CSS variables. It allows users who sign up online to theme their site through the administration dashboard without having to know CSS or manage their own custom templates.

Example
{{ managedStyles() }}

pageData

Page data allows you to access lots of data in your templates. The exact data available depends on your form, which payment provider, the type of payment and whether your payment has been processed and if a callback has been received.

Example
{{ set pageData = pageData() }}
Stripe Checkout - before callback received
Array
(
    [domain] => https://demo.dijonplatform.com
    [site] => demo
    [campaign] => donate_address
    [languageCode] => en
    [countryCode] => gb
    [pipelineFields] => Array
        (
        )

    [fields] => Array
        (
            [utm_source] => facebook
        )

    [amount] => 25
    [currency] => GBP
    [currencySymbol] => £
    [type] => payment_oneoff
    [provider] => payment_provider_stripe
    [language] => English
    [pageUrl] => /en-gb/donate-address
    [pagePath] => donate-address
)
Stripe Checkout - after callback received
Array
(
    [domain] => https://demo.dijonplatform.com
    [site] => demo
    [campaign] => donate_v2
    [languageCode] => en
    [countryCode] => gb
    [pipelineFields] => Array
        (
            [name] => Steve Example
            [firstName] => Steve
            [surname] => Example
            [email] => test@example.com
        )

    [fields] => Array
        (
            [name] => 
            [name_title] => 
            [first_name] => Steve
            [surname] => Example
            [address_1] => 122 Example Road
            [address_2] => 
            [address_3] => 
            [city] => Clifton
            [postcode] => EM8 3XT
            [country] => GB
            [email] => test@example.com
            [phone] => 03300430254
            [mobile] => 
            [age] => 
            [opt_in] => yes
            [opt_out_1] => 
            [opt_out_2] => 
            [utm_source] => 
            [giftaid] => 
            [unique_id] => 8ffefa0b706f57b6145d02978a9a51fbc74da68368aed253ccc46a554f78ee15
        )

    [amount] => 26.25
    [currency] => GBP
    [currencySymbol] => £
    [type] => payment_oneoff
    [provider] => payment_provider_stripe
    [language] => English
    [pageUrl] => /en-gb/donate-v2
    [pagePath] => donate-v2
)
Stripe Elements - before callback received
Array
(
    [domain] => https://demo.dijonplatform.com
    [site] => demo
    [campaign] => donate_v2
    [languageCode] => en
    [countryCode] => gb
    [pipelineFields] => Array
        (
        )

    [fields] => Array
        (
            [name] => 
            [name_title] => 
            [first_name] => Steve
            [surname] => Example
            [address_1] => 122 Example Road
            [address_2] => 
            [address_3] => 
            [city] => Clifton
            [postcode] => EM8 3XT
            [country] => GB
            [email] => test@example.com
            [phone] => 03300430254
            [mobile] => 
            [age] => 
            [opt_in] => yes
            [opt_out_1] => 
            [opt_out_2] => 
            [utm_source] => 
            [giftaid] => 
        )

    [amount] => 26.25
    [currency] => GBP
    [currencySymbol] => £
    [type] => payment_oneoff
    [provider] => payment_provider_stripe
    [language] => English
    [pageUrl] => /en-gb/donate-v2
    [pagePath] => donate-v2
Stripe Elements - after callback received
Array
(
    [domain] => https://demo.dijonplatform.com
    [site] => demo
    [campaign] => donate_v2
    [languageCode] => en
    [countryCode] => gb
    [pipelineFields] => Array
        (
            [name] => Steve Example
            [firstName] => Steve
            [surname] => Example
            [email] => test@example.com
        )
    [fields] => Array
        (
            [name] => 
            [name_title] => 
            [first_name] => Steve
            [surname] => Example
            [address_1] => 122 Example Road
            [address_2] => 
            [address_3] => 
            [city] => Clifton
            [postcode] => EM8 3XT
            [country] => GB
            [email] => test@example.com
            [phone] => 03300430254
            [mobile] => 
            [age] => 
            [opt_in] => yes
            [opt_out_1] => 
            [opt_out_2] => 
            [utm_source] => 
            [giftaid] => 
            [unique_id] => 50ef9e406476a02a84ee9acfbfec959ad557c07cb93cadf1e3030d3772e1579b
        )
    [amount] => 26.25
    [currency] => GBP
    [currencySymbol] => £
    [type] => payment_oneoff
    [provider] => payment_provider_stripe
    [language] => English
    [pageUrl] => /en-gb/donate-v2
    [pagePath] => donate-v2
)

pageDataDump

The page dump function allows you to see the data available to you in pageDump. It is included for your debugging purposes. The examples under pageDump were generated with this function.

{{ pageDataDump() }}

paymentMethods

Returns a list of available paymentMethods and related data, filtering the ones you supply for country, currency and if they are connected or set up with credentials.

Example
{% set paymentMethods = paymentMethods([
    'stripeElements', 'stripeCheckout', 'paypal', 'stripeCheckoutBacs'
]) %}

Print the donor name on a thank you page.

Example
{{ print_donor_name('Thank you %s', 'Thank you supporter') }}

Print the lead generation name on a thank you page.

Example
{{ print_leadgen_name('Thank you %s', 'Thank you supporter') }}

Print the lead generation field on a thank you page.

Example
{{ print_leadgen_success_field($fieldName, 'Thank you %s', 'Thank you supporter') }}

settings

Get settings as an array allowing you to make template decisions based on the settings you defined.

Example
{% set settings = settings() %}

totaliser

Include Totaliser. See Totalised.

uneditableTranslation

Translation language string. See Translations.

userCountry

Returns the user country as a string.

Example
{% set userCountry = userCountry() %}

userCurrency

Returns the user currency as a string.

Example
{% set userCurrency = userCurrency() %}

userLanguage

Returns the user language as a string.

Example
{% set userLanguage = userLanguage() %}

On this page