Loading
Page variables
Every page has access to these variables.

Variable Description
idid number assigned to page e.g. {{ page.id }}
title e.g. {{ page.title }}
name e.g. {{ page.name }}
slug e.g. {% if page.slug == 'innovation' %}
excerpt e.g. {{ page.excerpt }}
headline e.g. {{ page.headline }}
type_namePage type name e.g. Blog, Donation, etc.
type_slugType of page slug belongs to e.g. {{ page.type_slug }}
icon16x16 icon corresponding to the page's type e.g. {{ page.icon | icon }}
has_author?Does this page have an author?
author e.g. {{ page.author.published_name }}
published_atWhen this page was published e.g. {{ page.published_at | date: '%b %d, %Y %l:%M %p' }}
has_meta_image?Does the site have a primary image?
meta_image_urlLogo used by Facebook share/digg/etc. e.g. <img src="{{ page.meta_image_url }}" />
meta_image_medium_urlImage used by Facebook share/digg/etc. e.g. <img src="{{ page.meta_image_medium_url }}" />
meta_image_large_urlImage used by Facebook share/digg/etc. e.g. <img src="{{ page.meta_image_large_url }}" />
Variable Description
is_user_submitted?Was this page submitted by a user true or false
show_stream?Checks if the activity stream is enabled true or false
is_commentable?Checks if comments are enabled true or false
comments_countNumber of comments {{ page.comments_count }} comments
followers_count# of people following this page
followersAll the page followers
follow_urlURL to follow this page
unfollow_urlURL to unfollow this page
flag_urlURL to flag this page
has_rule_violation?Checks if the page violated a rule e.g. {% if page.has_rule_violation? %}
Variable Description
tweet_urlLink to tweet this page through Twitter
default_face_tweet_textDefault text used for the face tweet, and twitter/facebook sharing e.g. {{ page.default_face_tweet_text }}
default_tweet_textNo longer used
default_tweet_text_without_urlNo longer used
default_facebook_textNo longer used
google_buzz_urlPath to page's Google Buzz URL e.g. http://www.google.com/buzz/post?url=http://yourdomain.com/pages/nyc/recruiter_id=123
likes_countNumber of Facebook likes e.g. {{ page.likes_count }} likes
text_keyword_instructionsIf the action on this page can be taken by texting a keyword, this will give the instructions e.g. {{ page.text_keyword_instructions }} likes
Variable Description
is_homepage?Checks if the page is the homepage e.g. {% if page.is_homepage? == false %}
has_parent?Does this page have a parent? e.g. {% if page.has_parent? %}
parentThe parent page of this page. e.g. {{ page.parent.title }}
ancestorsAncestors of the page e.g. {% for ancestor in page.ancestors %}
self_and_ancestorsThe page itself and its ancestors e.g. {% for ancestor in page.ancestors %}
descendantsDescendants of the page e.g. {% for descendants in page.descendants %}
self_and_descendantsThe page itself and its descendants e.g.
has_children?Does this page have children? e.g.
childrenChildren of the page e.g.
children_countNumber of page children e.g.
has_subnav?Does this page have a subnav? e.g.
subnav_countNumber of subnav pages e.g.
nav_childrenSubnav pages e.g.
levelHow many levels deep in the hierarchy e.g.
leaf?Checks if the page is a leaf e.g. true or false
is_nav?Checks if page is in the top nav e.g. Toggled on/off in admin panel
is_supporter_nav?Checks if page is in the supporter nav e.g. Toggled on/off in admin panel
is_or_is_descendant_of_current_page?? e.g.
is_or_is_ancestor_of_current_page?? e.g.
most_recent_published_descendantsMost recently published descendants of page e.g.
most_recent_published_descendantMost recently published descendant of page e.g.
features_countNumber of published featured content sliders e.g. 2
featuresAll the featured content sliders e.g. {% for feature in page.features %}{% endfor %}
Variable Description
activitiesPaginated array of activities associated with this page e.g.
activities_countTotal number of reactions/activities public & private e.g. {{ page.activities_count }} reactions
public_activities_countNumber of public activities for page e.g. {{ page.public_activities_count }} reactions
private_activities_countNumber of private activities for page e.g. {{ page.private_activities_count }} not shown
page_leaderboardsDisplays any leaderboard for page e.g.
donations_amountTotal amount donated from page e.g. {{ page.donations_amount_format }} raised
donations_countTotal number of donations from page e.g. {{ page.donations_count }} donors
most_recent_donationMost recent donor from page
e.g. {{ page.most_recent_donation.signup.published_name_linked }}
pledges_amountTotal amount pledged from page e.g. {{ page.pledges_amount_format }} raised
pledges_countTotal number of pledges from page e.g. {{ page.pledges_count }} donors
tags_countTotal number of tags on this page e.g. {{ page.tags_count }} tags
tagsArray of page tags
Variable Description
urlLocal URL path e.g. pages/nyc
full_urlFull URL path e.g. http://yourdomain.com/pages/nyc
full_url_with_recruiterFull URL with recruiter id e.g. http://yourdomain.com/pages/nyc?recruiter_id=123
url_with_twitter_authorizationGet Twitter authorization, then go to this page e.g. /pages/nyc
url_with_facebook_authorizationGet Facebook authorization, then go to this page e.g. pages/nyc
url_with_facebook_email_authorizationGet Facebook authorization, including email address, then go to this page e.g. pages/nyc
admin_edit_urlLocal path to page's admin settings e.g. /admin/sites/1/pages/18/edit
admin_subpages_urlLocal path to page's subpages e.g. /admin/sites/1/pages/18/subpages
admin_new_subpage_urlLocal path to create a new subpage for page e.g. /admin/sites/1/pages/new?parent_id=18
admin_urlLocal path to page's admin dashboard e.g. /admin/sites/1/pages/new?parent_id=18
has_rss?Does this page have an RSS feed? e.g. {% if page.has_rss? %}{% endif %}
rss_urlURL of RSS feed e.g. http://3dna.us/blog.rss
Do you like this page?

Showing 13 reactions


Ron Smith commented 2013-04-09 06:44:41 -0700 · Flag
amy: to avoid case or whitespace issues, test for {{ page.type_slug }}, which will yield “petition”, “signup”, etc.
Amy Leaman commented 2013-04-03 18:35:49 -0700 · Flag
What are the different page.type_names? I’ve tried making if else statements with this variable a few times to no avail. i.e. {% if page.type_name == “Blog” %}
Jerimee Richir commented 2012-08-27 20:06:42 -0700 · Flag
Is there object ref for page.admin ?
Jerimee Richir commented 2012-07-07 13:24:20 -0700 · Flag
Answer to Ron’s question is here: http://nationbuilder.com/page_attachments
Ron Smith commented 2012-05-24 09:41:03 -0700 · Flag
How do we grab attached file names?
Jesse Haff commented 2012-01-29 09:15:29 -0800 · Flag
This is how you would use page.activities to display all activity on a page:

{% for activity in page.activities %}
{{ activity.show_page_view }}
{
% endfor %}
Jerimee Richir commented 2012-01-27 21:08:26 -0800 · Flag
How does one use page.activities? Is it an array?
Jesse Haff commented 2012-01-23 15:39:44 -0800 · Flag
Jermiee: It’s a page with no children (subpages).
Jerimee Richir commented 2012-01-23 15:29:47 -0800 · Flag
What is a leaf?
Jim Gilliam commented 2012-01-10 08:34:52 -0800 · Flag
short_url isn’t used any more because Twitter does its own URL shortening.
Jerimee Richir commented 2012-01-10 06:44:20 -0800 · Flag
maybe “share_url” ?
Jerimee Richir commented 2012-01-10 06:43:03 -0800 · Flag
Didn’t there used to be short_url or something like that?