Template API Custom Templates

Template API Reference

All of Liquid's syntax, standard filters, tags and blocks are supported.

Here is a list of everything else available to you in your custom templates:

Tags

body_class

Sets classes on the body tag

{% body_class home %}
cookie

Sets a cookie

{% cookie test = 'hello' %}
meta

Sets the meta tags to use for this page. Defaults are site, page, campaign and article.

Have a look in layout/meta to see how it's used.

{% meta article %}
session

Sets the secure session cookie

{% session test = 'hello' %}

Blocks

layout

Sets the layout for this view

{% layout %}{{ layout.default }}{% endlayout %}
{% layout %}{{ layout.dialog }}{% endlayout %}
{% layout %}layout_name{% endlayout %}
subtitle

Sets the subtitle in the tagline for this view

{% subtitle %}subtitle text{% endsubtitle %}
tagline

Sets the tagline title for this view

{% tagline %}subtitle text{% endtagline %}
title

Sets the document title for this view

{% title %}subtitle text{% endtitle %}

Filters

list filters
shuffle a

Shuffle array

{% assign new_array = array | shuffle %}
merge a1, a2

Merge arrays

{% assign new_array = array | merge: array2 %}
select a, options

Select the elements that match options (Hash)

find a, options

Select the elements that match options (Hash)

sort_by a, field

Sort by field value

option_list a, options = {}

Make options for country select

number filters
to_float num

Convert string or value to a float number

to_i num

Convert string or value to integer

minutes_in_words timestamp

Get minutes in words since time

to_currency val, options = {}

Display a number as currency

to_decimal val, options = {}

Display a float (percentage) with correct punctuation

min f

Remove the trailing decimals from a float number if any

increment num, step = 1

Increment number

decrement num, step = 1

Decrement number

query filters
read model, key

Alternate access to drop methods

where query, *options

Set up database query, return a cursor

limit query, limit

Set database query result limit

order query, *options

Set database query result order (sort)

all query

Execute query and return array of results

paginate query, options = {}

Paginate query and return array of results

count query

Count number of entries in database query. Alias for 'size'

json drop, options = {}

Get the json attributes from tag

category query, link, limit = nil

Used on the discover page to display campaigns

search string, location = nil

Campaign search

standard filters
date input, format = ''

Date format

text filters
t key, *args

Lookup translation

languages key

Return array of system languages

liquid str

Parse as liquid

script_tag paths

Script tag

style_tag paths

Style tag

encode input

Encode string. Aliases: e

unescape_html str

Unescape HTML

strip_html str

Strip html

iso_lang str

Get the iso version for languages

froala_lang str

Get the froala version for languages

flip str

Flip a string or number from -1 to 1

starts_with? string, pattern

Return true if string starts with pattern. Alias: start_with?

stamp path

Return the path with timestamp added

inspect var

Inspect object

klass var

Print class name of object

time filters
time time, options = {}

Standard time format

days_ago date, type = :noyear

Transform the date into how many days left

Models

ad model
Belongs to: site
article_comment model
Belongs to: article, user
article model
Belongs to: site, user
Has many: article_comments
Scopes: draft, finished, published
campaign model
Belongs to: group, site, user
Has many: comments, commitments, contributions, images, pledges, reminders, rewards, updates, votes
Scopes: active, approved, closed, deleted, ending, ending_in, featured, not_deleted, old_active, random, successful, unsuccessful, visible
category model
Belongs to: site
Scopes: custom, default, not_you, visible
comment model
Belongs to: campaign, user
commitment model
Belongs to: campaign, site
Has many: pledges
Scopes: visible
configuration model
Belongs to: site
contribution model
Belongs to: campaign, cost, fee, reward, site, user
Scopes: active, confirmed, has_reward, live, not_deleted, not_refunded, visible
conversation model
Belongs to: site, user
Has many: messages
Scopes: active
cost model
Belongs to: site
Has many: contributions
fee model
Belongs to: site
Has many: contributions
group model
Belongs to: site, user
Has many: campaigns, memberships
Scopes: visible
image model
Belongs to: campaign, site
membership model
Belongs to: group, site, user
message model
Belongs to: conversation, user
page model
Belongs to: site
Scopes: visible
pledge model
Belongs to: campaign, commitment, site, user
reminder model
Belongs to: campaign, user
reward model
Belongs to: campaign
Has many: contributions
Scopes: visible
site model
Belongs to: account
Has many: ads, articles, campaigns, categories, commitments, configurations, contributions, conversations, costs, fees, fields, groups, images, memberships, pages, payments, pledges, users, votes
update model
Belongs to: campaign, user
Scopes: draft, published
user model
Belongs to: site
Has many: authentications, campaigns, contributions, conversations, memberships, messages, pledges, votes
Scopes: approved, complete, deleted, not_deleted, unapproved, unconfirmed
vote model
Belongs to: campaign, site, user

Drops

ad drop
image

Ad image

url

Ad url

timestamp

Ad timestamp

site_id

Ad site_id

site

Ad site

article drop
link

Article link

published_at

Article published_at

title

Article title escaped

content_html

Article content_html

ingress

Article ingress escaped

ingress_html

Article ingress_html

description

Article description escaped

description_html

Article description_html

content

Article content escaped

image_url

Article image_url

finished

Article finished

published

Article published

tags

Article tags

vimeo?

Article vimeo?

youtube?

Article youtube?

image?

Article image?

video_id

Article video_id

set_video_image

Article set_video_image

url

Article url

user_id

Article user_id

site_id

Article site_id

user

Article user

site

Article site

article_comment drop
raw

Article comment raw escaped

html

Article comment html

user_id

Article comment user_id

article_id

Article comment article_id

user

Article comment user

article

Article comment article

campaign drop
name

Campaign name escaped

duration

Campaign duration

category_link

Campaign category_link

link

Campaign link

video_image

Campaign video_image

video_url

Campaign video_url

url

Campaign url

key

Campaign key

badge_embed

Campaign badge_embed

category_name

Campaign category_name escaped

custom_fields

Campaign custom_fields

headline

Campaign headline escaped

location

Campaign location escaped

pledged

Campaign pledged

percent

Campaign percent

status

Campaign status

expires_at

Campaign expires_at

expiring?

Campaign expiring?

video_embed_code

Campaign video_embed_code

goal

Campaign goal

min_goal

Campaign min_goal

max_goal

Campaign max_goal

about_html

Campaign about_html

about

Campaign about escaped

approved

Campaign approved

submitted

Campaign submitted

expired?

Campaign expired?

inactive?

Campaign inactive?

funded?

Campaign funded?

deleted

Campaign deleted

can_receive_contributions?

Campaign can_receive_contributions?

has_limit?

Campaign has_limit?

has_location?

Campaign has_location?

successful?

Campaign successful?

editable?

Campaign editable?

draft?

Campaign draft?

never_ending?

Campaign never_ending?

keep_it_all?

Campaign keep_it_all?

all_or_nothing?

Campaign all_or_nothing?

voting?

Campaign voting?

can_expire?

Campaign can_expire?

show_location?

Campaign show_location?

time_left_time

Campaign time_left_time

time_left_unit

Campaign time_left_unit

wepay_payment_authorized?

Campaign wepay_payment_authorized?

stripe_payment_authorized?

Campaign stripe_payment_authorized?

dwolla_payment_authorized?

Campaign dwolla_payment_authorized?

mangopay_payment_authorized?

Campaign mangopay_payment_authorized?

short_url

Campaign short_url

reminder_on

Campaign reminder_on

storage_used

Campaign storage_used

fixed_amount

Campaign fixed_amount

show_contribution_amount

Campaign show_contribution_amount

approved_at

Campaign approved_at

closed_at

Campaign closed_at

notes

Campaign notes escaped

location_data

Campaign location_data

reminders_sent

Campaign reminders_sent

successful_notified

Campaign successful_notified

paypal_account

Campaign paypal_account escaped

wepay_payment_account

Campaign wepay_payment_account escaped

wepay_payment_token

Campaign wepay_payment_token escaped

stripe_payment_account

Campaign stripe_payment_account escaped

stripe_payment_token

Campaign stripe_payment_token escaped

archived

Campaign archived

visible

Campaign visible

featured

Campaign featured

active

Campaign active

campaign_duration

Campaign campaign_duration

campaign_strategy

Campaign campaign_strategy

contribution_amount

Campaign contribution_amount

notifications

Campaign notifications

coupon_code

Campaign coupon_code escaped

vimeo_video?

Campaign vimeo_video?

youtube_video?

Campaign youtube_video?

facebook_video?

Campaign facebook_video?

image?

Campaign image?

video_id

Campaign video_id

get_video_image

Campaign get_video_image

get_pledged

Campaign get_pledged

awaiting_confirmation?

Campaign awaiting_confirmation?

awaiting_approval?

Campaign awaiting_approval?

can_be_approved

Campaign can_be_approved

get_campaign_duration

Campaign get_campaign_duration

rewardlist

Campaign rewardlist

commitmentlist

Campaign commitmentlist

contributions_count

Campaign contributions_count

contributions_active_count

Campaign contributions_active_count

comments_count

Campaign comments_count

commitments_count

Campaign commitments_count

pledges_count

Campaign pledges_count

rewards_count

Campaign rewards_count

updates_count

Campaign updates_count

votes_count

Campaign votes_count

json

Campaign json

contributors

Campaign contributors

activity

Campaign activity

user_id

Campaign user_id

site_id

Campaign site_id

group_id

Campaign group_id

user

Campaign user

site

Campaign site

group

Campaign group

category drop
name

Category name escaped

link

Category link

position

Category position

type

Category type

sort

Category sort

order

Category order

hidden

Category hidden

default?

Category default?

custom?

Category custom?

site_id

Category site_id

site

Category site

comment drop
raw

Comment raw escaped

html

Comment html

anonymous

Comment anonymous

user_id

Comment user_id

campaign_id

Comment campaign_id

user

Comment user

campaign

Comment campaign

commitment drop
name

Commitment name escaped

editable?

Commitment editable?

image_url

Commitment image_url

description

Commitment description escaped

description_html

Commitment description_html

max

Commitment max

visible

Commitment visible

images_enabled

Commitment images_enabled

images_required

Commitment images_required

taken?

Commitment taken?

campaign_id

Commitment campaign_id

site_id

Commitment site_id

campaign

Commitment campaign

site

Commitment site

configuration drop
enabled

Configuration enabled

stripe_publishable_key

Configuration stripe_publishable_key escaped

stripe_recurring

Configuration stripe_recurring

stripe_recurring_optional

Configuration stripe_recurring_optional

stripe_billing_fields

Configuration stripe_billing_fields

live?

Configuration live?

paypal_adaptive?

Configuration paypal_adaptive?

mangopay_adaptive?

Configuration mangopay_adaptive?

name

Configuration name escaped

link

Configuration link

live

Configuration live

adaptive

Configuration adaptive

login

Configuration login escaped

password

Configuration password escaped

signature

Configuration signature escaped

appid

Configuration appid escaped

email

Configuration email escaped

paypal_currency

Configuration paypal_currency

paypal_email

Configuration paypal_email escaped

client_id

Configuration client_id escaped

client_secret

Configuration client_secret escaped

access_token

Configuration access_token escaped

account_id

Configuration account_id escaped

bitpay_key

Configuration bitpay_key escaped

dwolla_key

Configuration dwolla_key escaped

dwolla_secret

Configuration dwolla_secret escaped

dwolla_id

Configuration dwolla_id escaped

stripe_secret_key

Configuration stripe_secret_key escaped

stripe_client_id

Configuration stripe_client_id escaped

stripe_currency

Configuration stripe_currency escaped

razorpay_api_key

Configuration razorpay_api_key escaped

site_id

Configuration site_id

site

Configuration site

contact drop
name

Contact name escaped

email

Contact email escaped

subject

Contact subject escaped

message

Contact message escaped

message_html

Contact message_html

contribution drop
cost_amount

Contribution cost_amount

cost_name

Contribution cost_name escaped

is_anonymous?

Contribution is_anonymous?

custom_fields

Contribution custom_fields

payment_method

Contribution payment_method

amount

Contribution amount

total

Contribution total

currency

Contribution currency

campaign_receives

Contribution campaign_receives

show_shipping_link

Contribution show_shipping_link

accept

Contribution accept

contributor_pays_fees

Contribution contributor_pays_fees

anonymous

Contribution anonymous

confirmed

Contribution confirmed

refunded

Contribution refunded

deleted

Contribution deleted

captured

Contribution captured

live_payment

Contribution live_payment

payment_token

Contribution payment_token

payment_type

Contribution payment_type

transaction_id

Contribution transaction_id

ip

Contribution ip

email

Contribution email escaped

name

Contribution name escaped

location

Contribution location

manual

Contribution manual

name_override

Contribution name_override escaped

capture

Contribution capture

min_amount

Contribution min_amount

max_amount

Contribution max_amount

platform_amount

Contribution platform_amount

payment_amount

Contribution payment_amount

fees_amount

Contribution fees_amount

full_amount

Contribution full_amount

description

Contribution description escaped

json

Contribution json

reward_id

Contribution reward_id

site_id

Contribution site_id

user_id

Contribution user_id

campaign_id

Contribution campaign_id

cost_id

Contribution cost_id

fee_id

Contribution fee_id

reward

Contribution reward

site

Contribution site

user

Contribution user

campaign

Contribution campaign

cost

Contribution cost

fee

Contribution fee

conversation drop
listener

Conversation listener

deletors

Conversation deletors

subject

Conversation subject escaped

get_listener

Conversation get_listener

other_user

Conversation other_user

active

Conversation active

user_id

Conversation user_id

site_id

Conversation site_id

user

Conversation user

site

Conversation site

cookie drop
set key, value

Cookie set(key, value)

cost drop
amount

Cost amount

name

Cost name escaped

percentage

Cost percentage

site_id

Cost site_id

site

Cost site

fee drop
name

Fee name escaped

percentage

Fee percentage

site_id

Fee site_id

site

Fee site

flash drop
info

Flash info

error

Flash error

group drop
link

Group link

image

Group image

name

Group name escaped

bio_html

Group bio_html

url

Group url

bio

Group bio escaped

hidden

Group hidden

member?

Group member?

total_amount

Group total_amount

site_id

Group site_id

user_id

Group user_id

site

Group site

user

Group user

users

Group users

image drop
name

Image name escaped

type

Image type escaped

url

Image url

thumb_url

Image thumb_url

timestamp

Image timestamp

file_size

Image file_size

image?

Image image?

extension

Image extension

thumb

Image thumb

key

Image key

thumb_key

Image thumb_key

site_id

Image site_id

campaign_id

Image campaign_id

site

Image site

campaign

Image campaign

layout drop
full_title

Layout full_title

title

Layout title

subtitle

Layout subtitle

tagline

Layout tagline

body_class

Layout body_class

meta

Layout meta

template

Layout template

default

Layout default

dialog

Layout dialog

pdf

Layout pdf

membership drop
user_id

Membership user_id

site_id

Membership site_id

group_id

Membership group_id

user

Membership user

site

Membership site

group

Membership group

message drop
content_html

Message content_html

content

Message content escaped

url

Message url

get_user

Message get_user

user_id

Message user_id

conversation_id

Message conversation_id

user

Message user

conversation

Message conversation

model drop
id

Model id

model_name

Model model_name

errors

Model errors

created_at

Model created_at

updated_at

Model updated_at

new_record?

Model new_record?

persisted?

Model persisted?

valid?

Model valid?

escape input

Model escape(input) escaped

encode input

Model encode(input)

zonify time

Model zonify(time)

scoped name

Model scoped(name)

page drop
html

Page html

hidden

Page hidden

link

Page link

title

Page title

meta_description

Page meta_description

subtitle

Page subtitle

raw

Page raw escaped

type

Page type

homepage

Page homepage

termspage

Page termspage

site_id

Page site_id

site

Page site

paginate drop
per_page

Paginate per_page

page

Paginate page

count

Paginate count

arrows

Paginate arrows

numbers

Paginate numbers

default

Paginate default

pledge drop
email

Pledge email escaped

name

Pledge name escaped

comment

Pledge comment escaped

comment_html

Pledge comment_html

anonymous

Pledge anonymous

commitment_id

Pledge commitment_id

site_id

Pledge site_id

campaign_id

Pledge campaign_id

user_id

Pledge user_id

commitment

Pledge commitment

site

Pledge site

campaign

Pledge campaign

user

Pledge user

query drop
first

Query first

last

Query last

all

Query all

paginate(options = params || {})

Query paginate(options = (params || {}))

where options

Query where(options)

order options

Query order(options)

limit x

Query limit(x)

count

Query count

reminder drop
user_id

Reminder user_id

campaign_id

Reminder campaign_id

user

Reminder user

campaign

Reminder campaign

request drop
url

Request url

fullpath

Request fullpath

absolutepath

Request absolutepath

referer

Request referer

xhr?

Request xhr?

reward drop
max

Reward max

description

Reward description escaped

description_html

Reward description_html

editable?

Reward editable?

images_required

Reward images_required

amount

Reward amount

image_url

Reward image_url

visible

Reward visible

images_enabled

Reward images_enabled

taken?

Reward taken?

site

Reward site

json

Reward json

campaign_id

Reward campaign_id

campaign

Reward campaign

session drop
set key, value

Session set

settings drop
countries

Settings countries

site drop
costs_enabled

Site costs_enabled

costs_required

Site costs_required

fees_enabled

Site fees_enabled

fees_required

Site fees_required

currency_display

Site currency_display

currency_display_right

Site currency_display_right

display_actual_currency

Site display_actual_currency

lang

Site lang

name

Site name escaped

campaign_location

Site campaign_location

domain

Site domain

default_categories

Site default_categories

groups_enabled

Site groups_enabled

groups_joinable

Site groups_joinable

groups_editable

Site groups_editable

random_limit

Site random_limit

random_on_empty

Site random_on_empty

category_options

Site category_options

classes

Site classes

title

Site title

title_separator

Site title_separator

tagline_title

Site tagline_title

tagline_title_homepage

Site tagline_title_homepage

tagline_subtitle

Site tagline_subtitle

logo

Site logo

secure_logo

Site secure_logo

meta_description

Site meta_description

head

Site head

libraries

Site libraries

css

Site css

hide_powered_by

Site hide_powered_by

languages

Site languages

sidebar

Site sidebar

navigation

Site navigation

scripts

Site scripts

sections

Site sections

page_id

Site page_id

mode

Site mode

disable_messages

Site disable_messages

json

Site json

homepage

Site homepage

extra_scripts

Site extra_scripts

extra_css

Site extra_css

curdel

Site curdel

fraction_symbol

Site fraction_symbol

timezone

Site timezone

rewards_enabled

Site rewards_enabled

rewards_required

Site rewards_required

reward_images_enabled

Site reward_images_enabled

reward_images_required

Site reward_images_required

max_rewards

Site max_rewards

commitments_enabled

Site commitments_enabled

commitments_required

Site commitments_required

commitment_images_enabled

Site commitment_images_enabled

commitment_images_required

Site commitment_images_required

max_commitments

Site max_commitments

protocol

Site protocol

google

Site google

hide_user_bio

Site hide_user_bio

tabs_visible

Site tabs_visible

updates_in_about

Site updates_in_about

contribution_amount

Site contribution_amount

login_to_contribute

Site login_to_contribute

anonymous_contributions

Site anonymous_contributions

gateway_fees

Site gateway_fees

platform_fee

Site platform_fee

share_buttons

Site share_buttons

share_button_text

Site share_button_text

share_button_style

Site share_button_style

user_fields

Site user_fields

approval_fields

Site approval_fields

campaign_fields

Site campaign_fields

contribution_fields

Site contribution_fields

contact_fields

Site contact_fields

vote_fields

Site vote_fields

video_types

Site video_types

video_type_hint

Site video_type_hint

min_amount

Site min_amount

max_amount

Site max_amount

fixed_amount

Site fixed_amount

fixed_amount_enabled

Site fixed_amount_enabled

fixed_amount_user_decide

Site fixed_amount_user_decide

min_goal

Site min_goal

max_goal

Site max_goal

duration

Site duration

badges_per_row

Site badges_per_row

default_per_page

Site default_per_page

has_sidebar?

Site has_sidebar?

badge_style

Site badge_style

theme

Site theme

theme_neue

Site theme_neue

tab_position

Site tab_position

disable_responsive

Site disable_responsive

favicon

Site favicon

mobile

Site mobile

storage_used

Site storage_used

storage_campaign

Site storage_campaign

storage_site

Site storage_site

termspage

Site termspage

facebook_login

Site facebook_login

google_login

Site google_login

configuration

Site configuration

hide_campaign_contributions

Site hide_campaign_contributions

subdomain

Site subdomain

owndomain

Site owndomain

ssl_enabled

Site ssl_enabled

redirect_url

Site redirect_url

redirect_all

Site redirect_all

link

Site link

default_language

Site default_language

tier

Site tier

domain_settings

Site domain_settings

api_key

Site api_key

captcha

Site captcha

disable_captcha

Site disable_captcha

default_avatar

Site default_avatar

default_campaign_image

Site default_campaign_image

editor

Site editor

blog_admin

Site blog_admin

blog_image

Site blog_image

campaign_duration

Site campaign_duration

campaign_strategy

Site campaign_strategy

campaign_strategies

Site campaign_strategies

voting_enabled?

Site voting_enabled?

default_currency

Site default_currency

footer

Site footer

contribution_confirmation

Site contribution_confirmation

contributor_pays_fees

Site contributor_pays_fees

campaigns_always_editable

Site campaigns_always_editable

campaigns_auto_visible

Site campaigns_auto_visible

password

Site password

encrypted_password

Site encrypted_password

password_enabled

Site password_enabled

campaign_login_required

Site campaign_login_required

email_confirmation

Site email_confirmation

non_profit

Site non_profit

ads_count

Site ads_count

users_count

Site users_count

campaigns_count

Site campaigns_count

groups_count

Site groups_count

emails

Site emails

signature

Site signature

disabled_emails

Site disabled_emails

bcc_emails

Site bcc_emails

greeting

Site greeting

translations

Site translations

to

Site to

facebook

Site facebook escaped

facebook_secret

Site facebook_secret escaped

twitter

Site twitter escaped

google_client_id

Site google_client_id escaped

google_client_secret

Site google_client_secret escaped

reward_images

Site reward_images

commitment_images

Site commitment_images

get_configuration

Site get_configuration

get_email

Site get_email

root_domain

Site root_domain

live_domain

Site live_domain

markdown?

Site markdown?

facebook_key

Site facebook_key

options

Site options

badge_translations

Site badge_translations

now

Site now

account_id

Site account_id

account

Site account

stats drop
days_unique

Stats days_unique

week_unique

Stats week_unique

month_unique

Stats month_unique

unique_total

Stats unique_total

stats_days

Stats stats_days

stats_week

Stats stats_week

stats_month

Stats stats_month

stats_total

Stats stats_total

contributions_day

Stats contributions_day

contributions_week

Stats contributions_week

contributions_month

Stats contributions_month

contributions_total

Stats contributions_total

votes_day

Stats votes_day

votes_week

Stats votes_week

votes_month

Stats votes_month

votes_total

Stats votes_total

stats

Stats stats

contributions

Stats contributions

votes

Stats votes

model

Stats model

update drop
raw

Update raw escaped

html

Update html

published

Update published

emails_sent

Update emails_sent

user_id

Update user_id

campaign_id

Update campaign_id

user

Update user

campaign

Update campaign

user drop
name

User name escaped

author

User author

blog_admin

User blog_admin

blogger?

User blogger?

custom_fields

User custom_fields

avatar

User avatar

avatar_type

User avatar_type

avatar_upload

User avatar_upload

gravatar_url

User gravatar_url

link

User link

email

User email escaped

password

User password escaped

password_confirmation

User password_confirmation escaped

pwhs

User pwhs

bio

User bio escaped

bio_html

User bio_html

website

User website escaped

address

User address escaped

payment_info

User payment_info escaped

update_emails

User update_emails

reset_token

User reset_token

token

User token

reset_at

User reset_at

deleted

User deleted

approved

User approved

incomplete

User incomplete

confirmation_token

User confirmation_token

pending_confirmation

User pending_confirmation

facebook_avatar

User facebook_avatar

reset_url

User reset_url

confirmation_url

User confirmation_url

campaigner?

User campaigner?

json

User json

authentications

User authentications

groups

User groups

site_id

User site_id

site

User site

vote drop
email

Vote email escaped

name

Vote name escaped

comment

Vote comment escaped

comment_html

Vote comment_html

anonymous

Vote anonymous

site_id

Vote site_id

user_id

Vote user_id

campaign_id

Vote campaign_id

site

Vote site

user

Vote user

campaign

Vote campaign

Menu