Context variables
Global context
Available in every template (layout, sections, pages).
| Variable | Type | Notes |
|---|---|---|
current_url | string | absolute URL of the request |
organization | organization | see Objects |
supporter_urls.login | string | login URL |
supporter_urls.logout | string | logout URL |
supporter_urls.dashboard | string | supporter private area |
supporter_urls.profile | string | supporter profile |
supporter_urls.donations | string | supporter donations |
supporter_urls.campaigns | string | supporter campaigns |
pages | list of pages | all published pages |
campaigns | list of campaigns | all campaigns |
menus | list of menus | |
menuitems | list of menu items | |
blogs | list of blogs | |
articles | list of articles |
note
The global lists (campaigns, pages, blogs, articles) expose the basic
attributes of each item. The current page variable (campaign, page, blog,
article, project) exposes all the attributes described in
Objects and attributes.
Per-page variables
Each view adds its own variables to the global context.
| Page | Template | Additional variables |
|---|---|---|
| Campaign | campaign | campaign; for a Lead campaign also form, custom_field_definitions, lead_form_success |
| Thank you | thankyou | checkout_campaign, checkout_campaign_url, checkout_supporter, checkout_donation, message_published, form |
| Peer campaign | peer_campaign | campaign, peer_campaign, stats |
| Peer campaign form | peer_campaign_form | form, supporter, campaign, peer_campaign |
| Page | page | page |
| Blog | blog | blog |
| Article | article | article |
| Project | project | project |
| Project list | project_list | projects |
The template used is the one for the type (e.g. campaign) or the one set on
the individual content (campaign.template).
Notes
supporterin the global context is currently alwaysNone.- SEO variables (
seo_title,seo_description,google_tag, …) live only in the header and are not accessible in theme templates. - The
donate, dashboard and supporter profile pages use separate system templates and not the sections engine.