Skip to main content

Context variables

Global context

Available in every template (layout, sections, pages).

VariableTypeNotes
current_urlstringabsolute URL of the request
organizationorganizationsee Objects
supporter_urls.loginstringlogin URL
supporter_urls.logoutstringlogout URL
supporter_urls.dashboardstringsupporter private area
supporter_urls.profilestringsupporter profile
supporter_urls.donationsstringsupporter donations
supporter_urls.campaignsstringsupporter campaigns
pageslist of pagesall published pages
campaignslist of campaignsall campaigns
menuslist of menus
menuitemslist of menu items
blogslist of blogs
articleslist 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.

PageTemplateAdditional variables
Campaigncampaigncampaign; for a Lead campaign also form, custom_field_definitions, lead_form_success
Thank youthankyoucheckout_campaign, checkout_campaign_url, checkout_supporter, checkout_donation, message_published, form
Peer campaignpeer_campaigncampaign, peer_campaign, stats
Peer campaign formpeer_campaign_formform, supporter, campaign, peer_campaign
Pagepagepage
Blogblogblog
Articlearticlearticle
Projectprojectproject
Project listproject_listprojects

The template used is the one for the type (e.g. campaign) or the one set on the individual content (campaign.template).

Notes

  • supporter in the global context is currently always None.
  • 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.