Loading
Site variables
Variable Description
slughttp://[slug].yourdomain.com/ e.g. www
nameName of your site e.g. Abe Lincoln for President
long_nameLonger name
candidate_name_or_site_nameCandidate's name, or the site name if no candidate e.g. Abe Lincoln
candidate_first_name_or_site_nameCandidate's first name, or the site name if no candidate e.g. Abe
titleDefault page title, important for search engines e.g. Abe Lincoln for President 2012
headlineSite headline e.g. Abe Lincoln
subheadlineSite subheadline e.g. for President
urlURL of homepage without the http e.g. abeforprez.com
full_urlURL of homepage e.g. http://abeforprez.com/
mobile_menu_urlURL of mobile menu e.g. /mobile_menu
ask_for_volunteers?Is asking for volunteers enabled on this site?
ask_for_mobiles?Ask for mobile numbers whenever possible
ask_to_publish_to_stream?Is the checkbox for asking people if they want to keep their form submissions turned on?
show_public_profiles?Are public profiles turned on?
show_parent_in_nav_dropdown?Include the parent page in the nav menu dropdowns (some people don't like it as it repeats the main button right underneath, but unfortunately many people don't release they can click on the top button and get to that page, which sometimes has the most important info on it)
is_homepage?Are you currently on the homepage? e.g. {% if site.is_homepage? %}
homepageHome page, a page object e.g. {{ site.homepage.url }}
has_button1?Is there a big button #1? e.g. {% if site.has_button1? %}
button1_textText for the first button e.g. {{ site.button1_text }}
button1_pagePage to link to for the first button e.g. {{ site.button1_page.url }}
has_button2?Is there a big button #2? e.g. {% if site.has_button2? %}
button2_textText for the first button e.g. {{ site.button2_text }}
button2_pagePage to link to for the second button e.g. {{ site.button2_page.url }}
has_button3?Is there a big button #3? e.g. {% if site.has_button3? %}
button3_textText for the third button e.g. {{ site.button3_text }}
button3_pagePage to link to for the third button e.g. {{ site.button3_page.url }}
has_donation_page?Is there a primary donation page? e.g. {% if site.has_donation_page? %}
donation_pagePrimary donation page e.g. {{ site.donation_page }}
has_membership_page?Is there a primary membership page? e.g. {% if site.has_membership_page? %}
has_volunteer_page?Is there a primary volunteer page? e.g. {% if site.has_volunteer_page? %}
volunteer_pagePrimary volunteer page e.g. {{ site.volunteer_page.url }}
has_rule_page?Is there a rules page? e.g. {{ site.has_rule_page? }}
rule_pageRules page e.g. {{ site.rule_page }}
has_friends_page?Is there a primary find friends page? e.g. {% if site.has_friends_page? %}
friends_pagePrimary find a friends page e.g. {{ site.friends_page.url }}
has_splash_page?Is there a splash page? e.g. {% if site.has_splash_page? %}
splash_pageSplash page for this site (optional) e.g. {{ site.splash_page.url }}
has_signup_page?Is there a signup page? e.g. {% if site.has_signup_page? %}
signup_pageSignup page for this site e.g. {{ site.signup_page.url }}
has_invoice_page?Is there a primary invoices page? e.g. {% if site.has_invoice_page? %}
invoice_pagePrimary invoices page e.g. {{ site.invoice_page.url }}
has_broadcaster?Is there an official broadcaster for this site e.g. {% if site.has_broadcaster? %}
broadcasterOfficial broadcaster for this site
has_twitter?Is there an official twitter account? e.g. {% if site.has_twitter? %}
has_facebook?Is there an official facebook or open graph page? e.g. {% if site.has_facebook? %}
has_facebook_page?Is there an official facebook page? e.g. {% if site.has_facebook_page? %}
is_facebook_like_dark?Is the Facebook like button set to dark (for darker themes)
facebook_colorschemeFacebook color scheme variable
open_graph_broadcasterThe broadcaster who uses this site as their homepage e.g. {{ site.open_graph_broadcaster.open_graph_type }}
has_meta_image?Does the site have a primary image?
meta_image_urlLogo used by Facebook share/digg/etc. e.g. <img src="{{ site.meta_image_url }}" />
meta_image_medium_urlImage used by Facebook share/digg/etc. e.g. <img src="{{ site.meta_image_medium_url }}" />
meta_image_large_urlImage used by Facebook share/digg/etc. e.g. <img src="{{ site.meta_image_large_url }}" />
has_header_image?Does the site have a header image?
header_image_url_960960px wide header image e.g. <img src="{{ site.header_image_url_960 }}" />
header_image_url_980980px wide header image e.g. <img src="{{ site.header_image_url_980 }}" />
has_background_image?Does the site have a background image? (used by some themes)
background_image_url e.g. <img src="{{ site.background_image_url }}" />
footer_contentContent for footer e.g. {{ site.footer_content }}
activitiesA paginated array of the 20 most recent public activity objects for the entire nation
root_nav_pagesAll the pages in the main nav e.g.
root_nav_pages_reversedSame as previous, just in reverse order
supporter_pagesAll the pages in the supporter nav e.g.
most_recent_pagesA paginated array of the 20 most recently published page
most_recent_petition_pagesA paginated array of the 20 most recently published petition pages
most_recent_endorsement_pagesA paginated array of the 20 most recently published endorsement pages
most_recent_blog_post_pagesA paginated array of the 20 most recently published blog post pages
most_recent_suggestion_pagesA paginated array of the 20 most recently published suggestion pages
most_recent_faq_pagesA paginated array of the 20 most recently published faq pages
most_recent_question_pagesA paginated array of the 20 most recently published question pages
most_recent_press_release_pagesA paginated array of the 20 most recently published press release pages
most_recent_survey_pagesA paginated array of the 20 most recently published survey pages
upcoming_event_pagesA paginated array of 20 upcoming event pages
recent_supportersA list of recent supporters by name e.g. {{ site.recent_supporters }}
recent_supporters_with_picturesA list of recent supporters by picture e.g. {{ site.recent_supporters_with_pictures }}
random_supportersA randomized list of all supporters by name e.g. {{ site.random_supporters }}
random_supporters_with_picturesA randomized list of all supporters by picture e.g. {{ site.random_supporters_with_pictures }}
Do you like this page?

Showing 21 reactions


Lilia Villa commented 2013-04-30 14:13:50 -0700 · Flag
You can also try:

{% if request.url_path contains “login” or request.url_path contains “user_sessions_new_wide” }
Show this
{
endif %}

This one looks for a key word in the url path, jesses version calls out the template.

Hope these help!
Amy Leaman commented 2013-04-30 14:12:48 -0700 · Flag
That’s awesome! Thanks so much, Jesse!
Jesse Haff commented 2013-04-30 14:10:54 -0700 · Flag
Yes, this will work:

{% if request.template == ‘user_sessions_new_wide’ }
code
{
endif %}
Amy Leaman commented 2013-04-30 14:08:50 -0700 · Flag
is there any variable that references the login page (i.e. /forms/user_sessions/new) so that you could have an if/else statement that references it?
Tony Truong commented 2013-01-22 16:57:03 -0800 · Flag
Oh I see, so all “lists” are actual object lists.
Lilia Villa commented 2013-01-22 16:34:59 -0800 · Flag
Tony, that output needs to be placed inside a forloop. for example:
{% for signup in site.random_supporters_with_pictures limit:10 }
{{ signup.profile_image }}
{
endfor %}
Tony Truong commented 2013-01-22 16:29:44 -0800 · Flag
Does {{ site.random_supporters_with_pictures }} work? or Does it have any dependencies for it to work? All I’m getting is a bunch of “#####” When I place it in my layout file.
Marjorie Roswell commented 2012-12-30 11:34:03 -0800 · Flag
docs seems to be missing {{ site.admin_dashboard_url }}
John Perea followed this page 2012-10-16 20:21:07 -0700
Lilia Villa commented 2012-09-25 17:35:21 -0700 · Flag
Keith, are you placing that code within a partial template and then using the subpage method to pull it?

For example: {% subpage “calendar” with “events_latest” %} would be what is placed where you want the code to appear, and the liquid code from the link Jerimee referred to would be what is placed in the _events_latest.html partial template. If you send us a link to the page you’re working on to help@nationbuilder.com we can look into this further for you.
Keith Messina commented 2012-09-25 09:51:49 -0700 · Flag
Jerimee – I tried that code, but it only loaded the data when I was on the calendar page. I’m looking for something to grab the information site-wide. I’m looking to pull a couple of pieces of info from the latest 3 upcoming events and put that minimal info in the header of the site so it can be seen from every page.

It seems like it has to use the site.upcoming_event_pages to do this, but there is no documentation on how to properly do so :(
Jerimee Richir commented 2012-09-25 07:25:44 -0700 · Flag
Keith Messina commented 2012-09-24 21:13:33 -0700 · Flag
Has anyone figured out the syntax or right way to use the site.upcoming_event_pages? I keep getting the error: Liquid error: PGError: ERROR: missing FROM-clause entry for table “types” LINE 1: …= “pages”.site_id WHERE (“pages”.site_id = 4 AND (types.name… ^ : SELECT …

That Jerimee mentioned but cannot figure out how to display the upcoming events.
Jerimee Richir commented 2012-09-08 18:55:33 -0700 · Flag
Will, no there isn’t.

Is site.header_image an object? How do you get the header image without resizing?
Will McMillian commented 2012-08-24 16:24:24 -0700 · Flag
Is there an array of all the pages on the site? Not just the most recent 20
Jerimee Richir commented 2012-08-15 13:50:17 -0700 · Flag
yes meta_image is logo

looks like dimension on meta_image_medium_url might be 90px wide

and meta_image_large_url might be 140px wide?

need to verify that…
Jerimee Richir commented 2012-08-15 13:44:14 -0700 · Flag
regarding has_meta_image? – that is the logo, right? the logo you set at /admin/sites/1/image
Brad Johnson commented 2012-08-14 13:08:08 -0700 · Flag
{{ site.id }} prints the site’s ID
Jerimee Richir commented 2012-05-24 16:07:08 -0700 · Flag
upcoming_event_pages does NOT work the way most_recent_pages et al work

attempting to use that way triggers an error:
Liquid error: PGError: ERROR: missing FROM-clause entry for table “types” LINE 1: …= “pages”.site_id WHERE (“pages”.site_id = 4 AND (types.name… ^ : SELECT
Jerimee Richir commented 2012-05-24 15:47:13 -0700 · Flag
Does has_calendar_page? work?