Page variables
Every page has access to these variables.
Variable |
Description |
id | id 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 }} |
attachments | Array of page attachments |
type_name | Page type name e.g. Blog, Donation, Petition Signature, etc. |
type_slug | Page type by slug e.g. blog, volunteer_signup, petition_signature |
icon | 16x16 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_at | When 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_url | Logo used by Facebook share/digg/etc. e.g. <img src="{{ page.meta_image_url }}" /> |
meta_image_medium_url | Image used by Facebook share/digg/etc. e.g. <img src="{{ page.meta_image_medium_url }}" /> |
meta_image_large_url | Image 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_count | Number of comments {{ page.comments_count }} comments |
followers_count | # of people following this page |
followers | All the page followers |
follow_url | URL to follow this page |
unfollow_url | URL to unfollow this page |
flag_url | URL to flag this page |
has_rule_violation? | Checks if the page violated a rule e.g. {% if page.has_rule_violation? %} |
Variable |
Description |
tweet_url | Link to tweet this page through Twitter |
default_face_tweet_text | Default text used for the face tweet, and twitter/facebook sharing e.g. {{ page.default_face_tweet_text }} |
default_tweet_text | No longer used |
default_tweet_text_without_url | No longer used |
default_facebook_text | No longer used |
google_buzz_url | Path to page's Google Buzz URL e.g. http://www.google.com/buzz/post?url=http://yourdomain.com/pages/nyc/recruiter_id=123 |
text_keyword_instructions | If 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? %} |
parent | The parent page of this page. e.g. {{ page.parent.title }} |
ancestors | Ancestors of the page e.g. {% for ancestor in page.ancestors %} |
self_and_ancestors | The page itself and its ancestors e.g. {% for ancestor in page.ancestors %} |
descendants | Descendants of the page e.g. {% for descendants in page.descendants %} |
self_and_descendants | The page itself and its descendants e.g. |
has_children? | Does this page have children? e.g. |
children | Children of the page e.g. |
children_count | Number of page children e.g. |
has_subnav? | Does this page have a subnav? e.g. |
subnav_count | Number of subnav pages e.g. |
nav_children | Subnav pages e.g. |
level | How 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_descendants | Most recently published descendants of page e.g. |
most_recent_published_descendant | Most recently published descendant of page e.g. |
features_count | Number of published featured content sliders e.g. 2 |
features | All the featured content sliders e.g. {% for feature in page.features %}{% endfor %} |
page_class_name | Used to trigger different CSS classes per pagetype in the "body" of the layout.html template |
Variable |
Description |
activities | Paginated array of activities associated with this page e.g. |
activities_count | Total number of reactions/activities public & private e.g. {{ page.activities_count }} reactions |
public_activities_count | Number of public activities for page e.g. {{ page.public_activities_count }} reactions |
private_activities_count | Number of private activities for page e.g. {{ page.private_activities_count }} not shown |
page_leaderboards | Displays any leaderboard for page e.g. |
donations_amount | Total amount donated from page e.g. {{ page.donations_amount_format }} raised |
donations_count | Total number of donations from page e.g. {{ page.donations_count }} donors |
most_recent_donation | Most recent donor from page e.g. {{ page.most_recent_donation.signup.published_name_linked }} |
pledges_amount | Total amount pledged from page e.g. {{ page.pledges_amount_format }} raised |
pledges_count | Total number of pledges from page e.g. {{ page.pledges_count }} donors |
tags_count | Total number of tags on this page e.g. {{ page.tags_count }} tags |
tags | Array of page tags |
consent_form? | Checks if the page has a consent form e.g. {% if page.consent_form? %} |
Variable |
Description |
url | Local URL path e.g. pages/nyc |
full_url | Full URL path e.g. http://yourdomain.com/pages/nyc |
full_url_with_recruiter | Full URL with recruiter id e.g. http://yourdomain.com/pages/nyc?recruiter_id=123 |
url_with_facebook_authorization | Get Facebook authorization, then go to this page e.g. pages/nyc |
url_with_facebook_email_authorization | Get Facebook authorization, including email address, then go to this page e.g. pages/nyc |
admin_edit_url | Local path to page's admin settings e.g. /admin/sites/1/pages/18/edit |
admin_subpages_url | Local path to page's subpages e.g. /admin/sites/1/pages/18/subpages |
admin_new_subpage_url | Local path to create a new subpage for page e.g. /admin/sites/1/pages/new?parent_id=18 |
admin_url | Local 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_url | URL of RSS feed e.g. http://3dna.us/blog.rss |