Liquid Reference

SaaS On-premises 2.0

The following variables are available in every Liquid template:

  • provider - all your services, plans and settings under one hood
  • urls - routes to built-in pages of the developers portal (login, signup etc.)
  • current_user - username, address and rights of the currently logged-in user
  • current_account - messages, applications and plans of the currently logged-in user
  • today - current date

Builtin pages can also have other variables available (they are mentioned in the CMS editor). For example, an edit user form edit will have a user variable assigned or while displaying an application detail, you can expect to have a variable application accessible.

The type of a variable (an important thing to know to use this reference) can be determined by putting a {% debug:help %} tag into the page which will list all the available variables and it's types in an HTML comment for you. However, usually they can be guessed quite easily from the method or variable name.


Drops

Tags

Filters


Drops (up)

Account drop (up)

A developer account. See User drop if you are looking for the email addresses or similar information.

<h2>Account organization name {{ current_account.name }}</h2>
<div>Plan {{ current_account.bought_account_plan.name }}</div>
<div>Telephone {{ current_account.telephone_number }}</div>

<div>{{ current_account.fields_plain_text }}</div>
<div>{{ current_account.extra_fields_plain_text }}</div>

{% if current_account.approval_required? %}
   <p>This account requires approval.</p>
{% endif %}

{% if current_account.credit_card_required? %}

  {% if current_account.credit_card_stored? %}
    <p>This account has credit card details stored in database.</p>
  {% else %}
    <p>Please enter your {{ 'credit card details' | link_to: urls.payment_details }}.</p>
  {% endif %}

  {% if current_account.credit_card_missing? %}
    <p>This account has no credit card details stored in database.</p>
  {% endif %}
{% endif %}

Methods

errors

If a form of this model is rendered after unsuccesfull submit, this returns" errors that occured.

<input name="account[name]"
       value="{{ account.name }}"
       class="{{ account.errors.name | error_class }}"/>
{{ account.errors.name | inline_errors }}
id

Returns the id of the account

name

Returns the organization name of the developer's account

vat_zero_text

Return a text about a vat zero

vat_rate

Return the vat rate

unread_messages

Unread messages

latest_messages

Return the latest messages

bought_account_plan

Returns the plan the account has contracted

bought_account_contract

Returns the contract account

credit_card_display_number
credit_card_expiration_date
credit_card_required?

Returns whether the account is required to enter credit card details

credit_card_stored?

Returns whether the account has credit card details stored

credit_card_missing?

Returns whether the account has no credit card details stored

timezone

Returns timezone of this account

paid?

Returns whether the account has at least a paid contract

on_trial?

Returns whether the account is on trial period, i.e. all his paid contracts has to be in trial period

telephone_number

Returns the telephone number of the account

approval_required?

Returns whether the account requires approval?

created_at

Returns UNIX timestamp of account creation (signup) Example: Converting timestamp to JavaScript Date

<script>
  var data = new Date({{ account.created_at }} * 1000);
</script>
full_address

Can be composed by legal address, city and state

applications

Returns the applications of the account

subscribed_services

Returns a array with ServiceContract drops

admin

Returns the admin user of this account

extra_fields_plain_text

Returns the extra fields defined for the account as plain text

fields_plain_text

Returns the fields defined for the account as plain text

extra_fields

Returns only extra fields with values of this account Example: Print all extra fields

{% for field in account.extra_fields %}
  {{ field.label }}: {{ field.value }}
{% endfor %}
fields

Returns all fields with values of this account Example: Print all fields

{% for field in account.fields %}
  {{ field.label }}: {{ field.value }}
{% endfor %}
builtin_fields
multiple_applications_allowed?
billing_address

Returns the billing address of this account

has_billing_address?

Returns whether this account has a billing address or not

can

Give access to permission methods

{% if account.can.be_deleted? %}
  <!-- do something -->
{% endif %}
edit_url
edit_ogone_billing_address_url
edit_braintree_blue_credit_card_details_url
domain
upgraded?
requires_credit_card?
support_email
finance_support_email

AccountPlan drop (up)

Example: Using account plan drop in liquid

<p class="notice">The examples for plan drop apply here</p>

Methods

selected?

Returns whether the plan is selected

{% if plan.selected? %}
  <p>You will signup to {{ plan.name }}</p>
{% endif %}
bought?

Returns whether the plan is bought

{% if plan.bought? %}
   <p>You are  on this plan already!</p>
{% endif %}
features

Returns an array of available features

setup_fee

Returns the setup fee

name

Returns the name of the plan

<h2>We offer you a new {{ plan.name }} plan!</h2>
system_name

Returns the system name of the plan

{% for plan in available_plans %}
  {% if plan.system_name == 'my_free_plan' %}
    <input type="hidden" name="plans[system_name]" value="{{ plan.system_name }}"/>
    <p>You will buy our only free plan!</p>
  {% endif %}
{% endfor %}
id

Returns the plan id

free?

The plan is free if it is not 'paid' (see the 'paid?' method)

{% if plan.free? %}
   <p>This plan is free of charge.</p>
{% else %}
   <div>
     <p>Plan costs</p>
     <div>Setup fee {{ plan.setup_fee }}</div>
     <div>Flat cost {{ plan.flat_cost }}</div>
  </div>
{% endif %}
paid?

The plan is 'paid' when it has non-zero fixed or setup fee or there are some pricing rules present

{% if plan.paid? %}
   <p>this plan is a paid one.</p>
{% else %}
   <p>this plan is a free one.</p>
{% endif %}
approval_required?

Returns whether the plan requires approval?

{% if plan.approval_required? %}
   <p>This plan requires approval.</p>
{% endif %}
flat_cost

Returns the monthly fixed fee of the plan


Alert drop (up)

Example: Using alert drop in liquid

<h2>Alert details</h2>
<div>Level {{ alert.level }}</div>
<div>Message {{ alert.message }}</div>
<div>Utilization {{ alert.utilization }}</div>

Methods

level

The alert level can be one of 50, 80, 90, 100, 120, 150, 200, 300.

message

Text message describing the alert, for example 'hits per minute: 5 of 5'

utilization

Decimal number marking the actual utilization that triggered the alert (1.0 is equal to 100%).

Used by {{ alert.utilization | times: 100 }} percent.

Application drop (up)

Example: Using application drop in liquid

<h2>Application {{ application.name }} (<span title="Application ID">{{ application.application_id }}</span>)</h2>
<p>{{ application.description }}</p>

Methods

errors

If a form of this model is rendered after unsuccesfull submit, this returns" errors that occured.

<input name="application[name]"
       value="{{ application.name }}"
       class="{{ application.errors.name | error_class }}"/>
{{ application.errors.name | inline_errors }}
id

Returns the id of the application

can_change_plan?

Returns 'true' if changing of the application is allowed either directly or by request.

trial?

Returns true if the contract is still in the trial period.

Note: If you change the trial period length of a plan, it does not affect the existing contracts.

live?
state

There are three possible states:

    - pending
    - live
    - suspended
remaining_trial_period_days

Number of day still left in the trial period.

plan

Returns a plan drop with the plan of the application

plan_change_permission_name

Returns name of the allowed action

plan_change_permission_warning

Returns a warning messenger of the allowed action

contract
admin_url

Returns the admin_url of the application

name

Returns the name of the application

can
oauth
pending?

Returns 'true' if application state is pending

buyer_alerts_enabled?
description

Returns the description of the application

redirect_url

Returns the redirect url for the OAuth of the application

filters_limit

Returns the amount of referrer filters allowed for this application

keys_limit

Returns the amount of application keys allowed for this application

referrer_filters

Returns the referrer filters associated with this application

rejection_reason

Returns the reason for rejecting an application

user_key

Returns the user_key of application

application_id

Returns the application_id of an application

key

Returns the application id or the user key

url

Returns URL of the builtin detail view for this application.

edit_url

Returns URL of the builtin edit view for this application.

update_user_key_url
log_requests_url
alerts_url
application_keys_url
service

Service to which that application belongs to.

keys

Returns the keys of an application

{% case application.keys.size %}
{% when 0 %}
  Generate your application key.
{% when 1 %}
  <h4>Application key for {{ application.name }} {{ application.application_id }}</h4>
  <p>Key is: {{ application.keys.first }}</p>
{% else %}
  <h4>Application keys for {{ application.name }} {{ application.application_id }}</h4>
  <ul>
    {% for key in application.keys %}
      <li>{{ key }}</li>
    {% endfor %}
  </ul>
{% endcase %}
oauth_mode?
user_key_mode?
app_id_mode?
change_plan_url
log_requests?
application_keys
extra_fields

Returns non-hidden extra fields with values for this application Example: Print all extra fields

{% for field in application.extra_fields %}
  {{ field.label }}: {{ field.value }}
{% endfor %}
fields

Returns all builtin and extra fields with values for this application Example: Print all fields

{% for field in application.fields %}
  {{ field.label }}: {{ field.value }}
{% endfor %}
builtin_fields

Returns only builtin fields of the application

cinstance

ApplicationKey drop (up)

Methods

id
value
url
application

ApplicationPlan drop (up)

Methods

selected?

Returns whether the plan is selected

{% if plan.selected? %}
  <p>You will signup to {{ plan.name }}</p>
{% endif %}
bought?

Returns whether the plan is bought

{% if plan.bought? %}
   <p>You are  on this plan already!</p>
{% endif %}
features

Returns the visible features of the plan

{% if plan == my_free_plan %}
   <p>These plans are the same.</p>
{% else %}
   <p>These plans are not the same.</p>
{% endif %}
setup_fee

Returns the setup fee of the plan

name

Returns the name of the plan

<h2>We offer you a new {{ plan.name }} plan!</h2>
system_name

Returns the system name of the plan

{% for plan in available_plans %}
  {% if plan.system_name == 'my_free_plan' %}
    <input type="hidden" name="plans[system_name]" value="{{ plan.system_name }}"/>
    <p>You will buy our only free plan!</p>
  {% endif %}
{% endfor %}
id

Returns the plan id

free?

The plan is free if it is not 'paid' (see the 'paid?' method)

{% if plan.free? %}
   <p>This plan is free of charge.</p>
{% else %}
   <div>
     <p>Plan costs</p>
     <div>Setup fee {{ plan.setup_fee }}</div>
     <div>Flat cost {{ plan.flat_cost }}</div>
  </div>
{% endif %}
paid?

The plan is 'paid' when it has non-zero fixed or setup fee or there are some pricing rules present

{% if plan.paid? %}
   <p>this plan is a paid one.</p>
{% else %}
   <p>this plan is a free one.</p>
{% endif %}
approval_required?

Returns whether the plan requires approval?

{% if plan.approval_required? %}
   <p>This plan requires approval.</p>
{% endif %}
flat_cost

Returns the monthly fixed fee of the plan

metrics

Returns the metrics of the plan

usage_limits

Returns the usage limits of the plan

service

Returns the service of the plan


Base drop (up)

Methods

login_url
user_identified?

Base drop (up)

Methods

errors

If a form of this model is rendered after unsuccesfull submit, this returns" errors that occured.

<input name="base[name]"
       value="{{ base.name }}"
       class="{{ base.errors.name | error_class }}"/>
{{ base.errors.name | inline_errors }}
title

Returns the title result

kind

Returns the kind of result, can be 'topic' or 'page'

url

Returns the resource url of the result

description

Returns a descriptive string for the result


BillingAddressField drop (up)

Methods

input_name
label
choices
errors
html_id
hidden?
visible?
read_only?
name
value
required

Can drop (up)

Methods

be_updated?
add_referrer_filters?
add_application_keys?
regenerate_user_key?
regenerate_oauth_secret?
manage_keys?
delete_key?

Can drop (up)

Methods

change_plan?

Cas drop (up)

Methods

login_url
user_identified?

Contract drop (up)

Plan of the contract {{ contract.plan.name }}

Methods

errors

If a form of this model is rendered after unsuccesfull submit, this returns" errors that occured.

<input name="contract[name]"
       value="{{ contract.name }}"
       class="{{ contract.errors.name | error_class }}"/>
{{ contract.errors.name | inline_errors }}
id

Returns the id

can_change_plan?

Returns true if any form of change is possible

trial?

Returns true if the contract is still in the trial period.

Note: If you change the trial period length of a plan, it does not affect the existing contracts.

live?
state

There are three possible states:

    - pending
    - live
    - suspended
remaining_trial_period_days

Number of day still left in the trial period.

plan

Returns the plan of the contract

plan_change_permission_name

Returns name of the allowed action

plan_change_permission_warning

Returns a warning messenger of the allowed action

contract

Country drop (up)

Methods

errors

If a form of this model is rendered after unsuccesfull submit, this returns" errors that occured.

<input name="country[name]"
       value="{{ country.name }}"
       class="{{ country.errors.name | error_class }}"/>
{{ country.errors.name | inline_errors }}
to_str
code
label

CountryField drop (up)

Methods

value

Returns ID of the country

{{ account.fields.country.value }} => 42

compare with:

{{ account.fields.country }} => 'United States'
name

Returns system name of the field

required
hidden?
hidden
visible?
visible
read_only
errors
input_name
html_id
label

Returns label of the field

{{ account.fields.country.label }}
<!-- => 'Country' -->
to_str

Returns name of the country

{{ account.fields.country }} => 'United States'
choices

CurrentUser drop (up)

Methods

errors

If a form of this model is rendered after unsuccesfull submit, this returns" errors that occured.

<input name="current_user[name]"
       value="{{ current_user.name }}"
       class="{{ current_user.errors.name | error_class }}"/>
{{ current_user.errors.name | inline_errors }}
admin?

Returns whether the user is an admin.

{% if user.admin? %}
  <p>You are an admin of your account.</p>
{% endif %}
username

Returns the username of the user, html escaped.

account

Returns the account of the user.

name

Returns the first and surname of the user.

email

Returns the email of the user.

password_required?

This method will return true for users using the builtin Developer Portal authentication mechanisms and false for those that are authenticated via Janrain, CAS or other single-sign-on method.

{{ if user.password_required? }}
  <input name="account[user][password]" type="password">
  <input name="account[user][password_confirmation]" type="password">
{{ endif }}
sections

Returns the list of sections the user has access to.

{% if user.sections.size > 0 %}
  <p>You can access following sections of our portal:</p>
   <ul>
    {% for section in user.sections %}
      <li>{{ section }}</li>
    {% endfor %}
  </ul>
{% endif %}
role

Returns the role of the user

roles_collection

Retuns a list of available roles for the user

{% for role in user.roles_collection %}
  <li>
    <label for="user_role_{{ role.key }}">
      <input
        {% if user.role == role.key %}
          checked="checked"
        {% endif %}
      class="users_ids" id="user_role_{{ role.key }}" name="user[role]" type="radio" value="{{ role.key }}">
      {{ role.text }}
    </label>
    </li>
  {% endfor %}
url

Return the resource url of the user

{{ 'Delete' | delete_button: user.url }}
edit_url

Return the url to edit the user

{{ 'Edit' | link_to: user.edit_url, title: 'Edit', class: 'action edit' }}
can

Exposes rights of current user which are dependent on your settings and user's role. You can call these methods on the returned object:

  • invite_user?
  • create_application?
  • see_log_requests?
{% if current_user.can.see_log_requests? and application.log_requests? %}
   (<a href="{{ application.log_requests_url }}" class="action edit">App Request Log</a>)
{% endif %}
extra_fields

Returns non-hidden extra fields with values for this user Example: Print all extra fields

{% for field in user.extra_fields %}
  {{ field.label }}: {{ field.value }}
{% endfor %}
fields

Returns all fields with values for this user Example: Print all fields

{% for field in user.fields %}
  {{ field.label }}: {{ field.value }}
{% endfor %}
builtin_fields

Returns all builtin fields with values for this user


Error drop (up)

When a form fails to submit because of invalid data, the errors array will be available on the related model.

Methods

attribute

Returns attribute of the model to this error is related

{{ account.errors.org_name.first.attribute }}
<!-- org_name -->
message

Returns description of the error

{{ account.errors.first.message }}
<!-- can't be blank -->
value

Returns value of the attribute to which the error is related

{{ account.errors.org_name.first.value }}
 <!-- => "ACME Co." -->
to_str

Returns full description of the error (includes the attribute name)

{{ model.errors.first }}
<!-- => "Attribute can't be blank" -->

Errors drop (up)

Example: get all errors

{% for error in form.errors %}
  attribute: {{ error.attribute }}
  ...
{% endfor %}

Methods

empty?

Returns true if there are no errors

{% if form.errors == empty %}
  Congratulations! You have no errors!
{% endif %}
present?

Returns true if there are some errors

{% if form.errors == present %}
  Sorry, there were some errors.
{% endif %}

Feature drop (up)

Methods

errors

If a form of this model is rendered after unsuccesfull submit, this returns" errors that occured.

<input name="feature[name]"
       value="{{ feature.name }}"
       class="{{ feature.errors.name | error_class }}"/>
{{ feature.errors.name | inline_errors }}
name

Returns the name of the feature

<h2>Feature {{ feature.name }}</h2>
description

Returns the description of the feature

has_description?

Returns whether the feature has description

{% if feature.has_description? %}
  {{ feature.description }}
{% else %}
   This feature has no description.
{% endif %}

Field drop (up)

Methods

value

Returns value if the field

Name: {{ account.fields.first_name.value }}
name

Returns system name of the field

required
hidden?
hidden
visible?
visible
read_only
errors
input_name

Returns name for the HTML input that is expected when the form is submitted.

<input name="{{ account.fields.country.input_name }}" value="{{account.fields.country}}" />
<!-- the 'name' attribute will be 'account[country]' -->
html_id

Returns a unique field identifier that is commonly used as HTML ID attribute.

{{ account.fields.country.html_id }}
<!--  => 'account_country' -->
label

Returns label of the field

{{ account.fields.country.label }}
<!-- => 'Country' -->
to_str

Returns value of the field if used as variable

{{ account.fields.first_name }} => 'Tom'
choices

Returns array of choices available for that field, if any. For example for a field called fruit it may respond with ['apple', 'bannana', 'orange'].

You can define the choices in your admin dashboard. Each of the array elements responds to id and label which are usually just the same unless the field is a special builtin one (like country) It is recommended to use those methods rather that output the choice 'as is' for future compatibility.

{% for choice in field.choices %}
  <select name="{{ field.input_name }}" id="{{ field.html_id }}_id"
          class="{{ field.errors | error_class }}">
  <option {% if field.value == choice %} selected {% endif %} value="{{ choice.id }}">
    {{ choice }}
  </option>
{% endfor %}

Flash drop (up)

Methods

messages

Return an array of messages

{% for message in flash.messages %}
   <p id="flash-{{ message.type }}">
     {{ message.text }}
   </p>
{% endfor %}

Forum drop (up)

Methods

enabled?

Returns true if you have forum functionality enabled.

{% if forum.enabled? %}
  <a href="/forum">Check out our forum!</a>
{% endif %}
latest_posts

I18n drop (up)

Provide useful strings for i18n support.

{{ object.some_date | date: i18n.long_date }}

Methods

short_date

Alias for %b %d

Dec 11
long_date

Alias for %B %d, %Y

December 11, 2013
default_date

Alias for %Y-%m-%d

2013-12-11

Invitation drop (up)

<div> Email: {{ invitation.email }} </div>
<div>

<tr id="invitation_{{ invitation.id }}">
  <td> {{ invitation.email }} </td>
  <td> {{ invitation.sent_at | date: i18n.short_date }} </td>
  <td>
    {% if invitation.accepted? %}
      yes, on {{invitation.accepted_at | format: i18n.short_date }}
    {% else %}
      no
    {% endif %}
  </td>
</tr>

Methods

errors

If a form of this model is rendered after unsuccesfull submit, this returns" errors that occured.

<input name="invitation[name]"
       value="{{ invitation.name }}"
       class="{{ invitation.errors.name | error_class }}"/>
{{ invitation.errors.name | inline_errors }}
email

Returns email address

accepted?

Returns true if the invitation was accepted

accepted_at

Returns a date if the invitations was accepted

{{ invitation.accepted_at | date: i18n.short_date }}
sent_at

Returns the creation date

{{ invitation.sent_at | date: i18n.short_date }}
resend_url

Returns the url for resend the invitation

{{ "Resend" | update_button: invitation.resend_url}}
url

Returns the resource url

{{ "Delete" | delete_button: invitation.url }}

Invoice drop (up)

Methods

errors

If a form of this model is rendered after unsuccesfull submit, this returns" errors that occured.

<input name="invoice[name]"
       value="{{ invoice.name }}"
       class="{{ invoice.errors.name | error_class }}"/>
{{ invoice.errors.name | inline_errors }}
friendly_id

Returns a friendly id

<td> {{ invoice.id }} </td>
<td> {{ invoice.name }} </td>
<td> {{ invoice.state }} </td>
<td> {{ invoice.cost }} {{ invoice.currency }} </td>
name

String composed by month and year

state
cost

Returns a number with two decimals

23.00
currency
cost_without_vat

Returns cost withot VAT

vat_amount

Returns vat ammount

exists_pdf?

Return true if the pdf was generated

period_begin
{{ invoice.period_begin | date: i18n.short_date }}
period_end
{{ invoice.period_end | date: i18n.long_date }}
issued_on
{{ invoice.issued_on | date: i18n.long_date }}
due_on
{{ invoice.due_on | date: i18n.long_date }}
paid_on
{{ invoice.paid_on | date: i18n.long_date }}
vat_code
fiscal_code
account

Return a AccountDrop

buyer_account
line_items

Returns a array of LineItemDrop

{% for line_item in invoice.line_items %}
  <tr class="line_item {% cycle 'odd', 'even' %}">
    <th>{{ line_item.name }}</th>
    <td>{{ line_item.description }}</td>
    <td>{{ line_item.quantity }}</td>
    <td>{{ line_item.cost }}</td>
  </tr>
{% endfor %}
payment_transactions

Returns a array of PaymentTransactionDrop

{% for payment_transaction in invoice.payment_transactions %}
  <tr>
    <td> {% if payment_transaction.success? %} Success {% else %} Failure {% endif %} </td>
    <td> {{ payment_transaction.created_at }} </td>
    <td> {{ payment_transaction.reference }} </td>
    <td> {{ payment_transaction.message }} </td>
    <td> {{ payment_transaction.amount }} {{ payment_transaction.currency }} </td>
  </tr>
{% endfor %}
url

Return the resource url of the invoice

{{ "Show" | link_to: invoice.url }}
pdf_url

Return the resource url of the invoice pdf

{{ "PDF" | link_to: invoice.pdf_url }}

Janrain drop (up)

Methods

login_url
user_identified?
session_url
relying_party

LineItem drop (up)

Methods

errors

If a form of this model is rendered after unsuccesfull submit, this returns" errors that occured.

<input name="line_item[name]"
       value="{{ line_item.name }}"
       class="{{ line_item.errors.name | error_class }}"/>
{{ line_item.errors.name | inline_errors }}
name
{% for line_item in invoice.line_items %}
  <tr class="line_item {% cycle 'odd', 'even' %}">
    <th>{{ line_item.name }}</th>
    <td>{{ line_item.description }}</td>
    <td>{{ line_item.quantity }}</td>
    <td>{{ line_item.cost }}</td>
  </tr>
{% endfor %}
description
quantity
cost

Message drop (up)

Methods

errors

If a form of this model is rendered after unsuccesfull submit, this returns" errors that occured.

<input name="message[name]"
       value="{{ message.name }}"
       class="{{ message.errors.name | error_class }}"/>
{{ message.errors.name | inline_errors }}
id

Returns the id of the message

subject

If subject is not present then either a truncated body or (no subject) string is returned.

body

Body of the message

created_at

Returns the creation date

{{ message.created_at | date: i18n.short_date }}
url

URL of the message detail, points either to inbox or outbox.

state

Either 'read' or 'unread'

sender

Returns the name of the sender

to

Returns the name of the receiver

recipients

Message drop (up)

Methods

type

The possible types of the messages are:

  • success (not used by now)
  • info
  • warning
  • danger
text

Metric drop (up)

Methods

errors

If a form of this model is rendered after unsuccesfull submit, this returns" errors that occured.

<input name="metric[name]"
       value="{{ metric.name }}"
       class="{{ metric.errors.name | error_class }}"/>
{{ metric.errors.name | inline_errors }}
unit

Returns the unit of the metric

This metric is measured in {{ metric.unit | pluralize }}
description

Returns the description of the metric

name

Returns the name of the metric

<h4>Metric {{ metric.name }}</h4>
<p>{{ metric.description }}</p>
system_name

Returns the system name of this metric

<h4>Metric {{ metric.name }}</h4>
<p>{{ metric.system_name }}</p>
usage_limits

Returns the usage limits of the metric

{% if metric.usage_limits.size > 0 %}
   <p>Usage limits of the metric</p>
   <ul>
     {% for usage_limit in metric.usage_limits %}
       <li>{{ usage_limit.period }} : {{ usage_limit.value }}</li>
     {% endfor %}
   </ul>
 {% else %}
   <p>This metric has no usage limits</p>
{% endif %}
pricing_rules

Returns the pricing rules of the metric

{% if metric.pricing_rules.size > 0 %}
  <p>Pricing rules of the metric</p>
  <ul>
  {% for pricing_rule in metric.pricing_rules %}
    <li>{{ pricing_rule.cost_per_unit }}</li>
  {% endfor %}
  </ul>

{% else %}
  <p>This metric has no pricing rules</p>
{% endif %}
has_parent

Page drop (up)

Methods

errors

If a form of this model is rendered after unsuccesfull submit, this returns" errors that occured.

<input name="page[name]"
       value="{{ page.name }}"
       class="{{ page.errors.name | error_class }}"/>
{{ page.errors.name | inline_errors }}
title

Returns the title of the page

<title>{{ page.title }}</title>
system_name

Returns system name of the page

{% if page.system_name == 'my_page' %}
  {% include 'custom_header' %}
{% endif %}

Page drop (up)

Methods

errors

If a form of this model is rendered after unsuccesfull submit, this returns" errors that occured.

<input name="page[name]"
       value="{{ page.name }}"
       class="{{ page.errors.name | error_class }}"/>
{{ page.errors.name | inline_errors }}
title
kind
url
description

Pagination drop (up)

Methods

page_size

Number of items on one full page.

<div class="pagination">
  {% for part in pagination.parts %}
    {% if part.is_link %}
      {% case part.rel %}
      {% when 'previous' %}
        {% assign css_class = 'previous_page' %}
      {% when 'next' %}
        {% assign css_class = 'next_page' %}
      {% else %}
        {% assign css_class = '' %}
      {% endcase %}

      <a class="{{ css_class }}" rel="{{ part.rel}}" href="{{ part.url }}">{{ part.title }}</a>
    {% else %}
      {% case part.rel %}
      {% when 'current' %}
         <em class="current">{{ part.title }}</em>
      {% when 'gap' %}
         <span class="gap">&#x2026;</span>
      {% else %}
         <span>{{ part.title }}</span>
      {% endcase %}
    {% endif %}
  {% endfor %}
</div>


<!-- Outputs:
  ============================================
<div class="pagination">
  <a class="previous_page" rel="prev" href="?page=7">&#x2190; Previous</a>
  <a rel="start" href="?page=1">1</a>
  <a href="?page=2">2</a>
  <a href="?page=3">3</a>
  <a href="?page=4">4</a>
  <a href="?page=5">5</a>
  <a href="?page=6">6</a>
  <a rel="prev" href="?page=7">7</a>
  <em class="current">8</em>
  <a rel="next" href="?page=9">9</a>
  <a href="?page=10">10</a>
  <a href="?page=11">11</a>
  <a href="?page=12">12</a>
  <span class="gap">&#x2026;</span>
  <a href="?page=267">267</a>
  <a href="?page=268">268</a>
  <a class="next_page" rel="next" href="?page=9">Next &#x2192;</a>
</div>
=======================================
-->
current_page

Number of the currently selected page.

current_offset

Items skipped so far.

pages

Total number of pages.

items

Total number of items in all pages together.

previous

Number of the previous page or empty.

next

Number of the next page or empty.

parts

Elements that help to render a user-friendly pagination. See the part drop for more information.


Part drop (up)

Methods

url
rel
current?
is_link
title
to_s

PaymentGateway drop (up)

Methods

braintree_blue?

Returns whether current payment gateway is authorize.Net

authorize_net?

Returns whether current payment gateway is authorize.Net

type

Returns the type of this payment gateway.


PaymentTransaction drop (up)

Methods

errors

If a form of this model is rendered after unsuccesfull submit, this returns" errors that occured.

<input name="payment_transaction[name]"
       value="{{ payment_transaction.name }}"
       class="{{ payment_transaction.errors.name | error_class }}"/>
{{ payment_transaction.errors.name | inline_errors }}
currency

Returns the currency

{% for payment_transaction in invoice.payment_transactions %}
  <tr>
    <td> {% if payment_transaction.success? %} Success {% else %} Failure {% endif %} </td>
    <td> {{ payment_transaction.created_at }} </td>
    <td> {{ payment_transaction.reference }} </td>
    <td> {{ payment_transaction.message }} </td>
    <td> {{ payment_transaction.amount }} {{ payment_transaction.currency }} </td>
  </tr>
{% endfor %}
amount

Returns the amount

created_at

Returns the creation date

success?

Returns true if was success

message

Returns the message of the transaction

reference

Returns the reference


PlanFeature drop (up)

Methods

errors

If a form of this model is rendered after unsuccesfull submit, this returns" errors that occured.

<input name="plan_feature[name]"
       value="{{ plan_feature.name }}"
       class="{{ plan_feature.errors.name | error_class }}"/>
{{ plan_feature.errors.name | inline_errors }}
name

Returns the name of the feature

<h2>Feature {{ feature.name }}</h2>
description

Returns the description of the feature

has_description?

Returns whether the feature has description

{% if feature.has_description? %}
  {{ feature.description }}
{% else %}
   This feature has no description.
{% endif %}
enabled?

Post drop (up)

Methods

errors

If a form of this model is rendered after unsuccesfull submit, this returns" errors that occured.

<input name="post[name]"
       value="{{ post.name }}"
       class="{{ post.errors.name | error_class }}"/>
{{ post.errors.name | inline_errors }}
body

Text of the post.

topic

Every post belongs to a topic

created_at

Date when this post created

{{ post.created_at | date: i18n.short_date }}
url

The url of this post within its topic


Post drop (up)

Methods

errors

If a form of this model is rendered after unsuccesfull submit, this returns" errors that occured.

<input name="post[name]"
       value="{{ post.name }}"
       class="{{ post.errors.name | error_class }}"/>
{{ post.errors.name | inline_errors }}
title
kind
url
description

PricingRule drop (up)

Methods

cost_per_unit

Returns the cost per unit of the pricing rule Example: Using pricing rule drop in liquid

<h2>Pricing rule</h2>
<div>Min value {{ pricing_rule.min }}</div>
<div>Max value {{ pricing_rule.max }}</div>
<div>Cost per unit {{ pricing_rule.cost_per_unit }}</div>
min

Returns the minimum value of the pricing rule

max

Returns the maximum value of the pricing rule

plan

Returns plan of pricing rule


Provider drop (up)

Methods

name

Returns the name of your organization.

<div>Domain {{ provider.domain }}</div>

{% if provider.multiple_applications_allowed? %}
   <div>
     <p>Applications</p>
     <ul>
     {% for app in account.applications %}
       <li>{{ app.name }}</li>
     {% endfor %}
     </ul>
   </div>
{% else %}
   <div>Application {{ account.applications.first.name }}</div>
{% endif %}

For general questions contact us at {{ provider.support_email }},
for invoice or payment related questions contact us at {{ provider.finance_support_email }}
payment_gateway

Returns the payment gateway associated with your organization

domain

Domain of your developer portal

timezone

Returns timezone that you use. Can be changed in your administration dashboard.

support_email

Support email of the account

finance_support_email

Finance support email of the account

telephone_number

Returns the telephone number of the account

multiple_applications_allowed?

True if developers can have more separate applications with their own keys, stats, etc. Depends on your 3scale plan.

{% if provider.multiple_applications_allowed? %}
   <div>
     <p>Applications</p>
     <ul>
     {% for app in account.applications %}
       <li>{{ app.name }}</li>
     {% endfor %}
     </ul>
   </div>
{% else %}
   <div>Application {{ account.applications.first.name }}</div>
{% endif %}
logo_url

Return the logo url

<img src={{ provider.logo_url }}"/>
multiple_services_allowed?

True if your 3scale plan allows you to manage multiple APIs as separate services.

{% if provider.multiple_services_allowed? %}
  {% for service in provider.services %}
     Service {{ service.name }} is available.
  {% endfor %}
{% endif %}
finance_allowed?
multiple_users_allowed?

True if the developer accounts can have multiple logins associated with them (depends on your 3scale plan) and its visibility has been turned on for your develoeper portal in the settings.

{% if provider.multiple_users_allowed? %}
  <ul id="subsubmenu">
    <li>
       {{ 'Users' | link_to: urls.users }}
    </li>
    <li>
      {{ 'Sent invitations' | link_to: urls.invitations }}
    </li>
  </ul>
{% endif %}
account_plans

Returns all published account plans.

<p>We offer following account plans:</p>
<ul>
{% for plan in model.account_plans %}
  <li>{{ plan.name }} <input type="radio" name="plans[id]" value="{{ plan.id }}"/></li>
{% endfor %}
</ul>
services

Returns all defined services.

<p>You can signup to any of our services!</p>
<ul>
{% for service in provider.services %}
  <li>{{ service.name }} <a href="/signup/service/{{ service.system_name }}">Signup!</a></li>
{% endfor %}
signups_enabled?

You can enable or disable signups in the Usage rules section of your Admin Portal.

account_management_enabled?

You can enable or disable account management in the Usage rules section.


ReferrerFilter drop (up)

Methods

id
value
delete_url
application

Request drop (up)

Example: Using request drop in liquid

<h2>Request details</h2>
<div>URI {{ request.request_uri }}</div>
<div>Host {{ request.host }}</div>
<div>Host and port {{ request.host_with_port }}</div>

Methods

request_uri

Returns the URI of the request

host_with_port

Returns the host with port of the request

host

Returns the host part of the request URL

path

Returns the path part of the request URL

{% if request.path == '/' %}
  Welcome on a landing page!
{% else %}
  This just an ordinary page.
{% endif %}

Role drop (up)

Methods

name

Return internal name of the role, important for the system

description

Return a descriptiptive text for the role


Search drop (up)

Methods

errors

If a form of this model is rendered after unsuccesfull submit, this returns" errors that occured.

<input name="search[name]"
       value="{{ search.name }}"
       class="{{ search.errors.name | error_class }}"/>
{{ search.errors.name | inline_errors }}
query

Returns the searched string

<h3>{{ search.token }}</h3>
<p>found on {{ search.total_found }} {{ search.item | pluralize }} </p>
<dl>
  {% for result in search.results %}
    <dt>
      <span class="kind"> [ {{ result.kind | capitalize}} ] </span>
      {{ result.title | link_to: result.url }}
    </dt>
    <dd>
      {{ result.description }}
    </dd>
  {% endfor %}
</dl>
total_found

Returns the number of matching elements

results

Returs an array of results for que search


Service drop (up)

Methods

errors

If a form of this model is rendered after unsuccesfull submit, this returns" errors that occured.

<input name="service[name]"
       value="{{ service.name }}"
       class="{{ service.errors.name | error_class }}"/>
{{ service.errors.name | inline_errors }}
name

Returns the name of the service

system_name

Returns the system name of the service

{% case service.system_name %}
{% when 'api' %}
  API is our newest service!
{% when 'old' %}
  Unfortunately we dont allow more signups to our old service.
{% endcase %}
description

Returns the description of the service

subscribed?

Returns whether the service is subscribed

{% if service.subscribed? %}
   <p>You already subscribed this service.</p>
{% endif %}
subscription

Returns a subscription(ServiceContract drop) if the currently logged in user is subscribed to this service, Nil otherwise.

{% if service.subscription %}
   Your applications for service {{ service.name }} are:
   {% for app in service.subscription.applications %}
     {{ app.name }}<br/>
   {% endfor %}
{% else %}
   <p>You are not subscribed to this.</p>
{% endif %}
subscribable?
subscribe_url
application_plans

Returns the published application plans of the service

{% for service in model.services %}
  <h4>{{ service.name }} application plans:</h4>
  <dl>
  {% for application_plan in service.application_plans %}
    <dt>{{ application_plan.name }}</dt>
    <dd>{{ application_plan.system_name }}</dd>
  {% endfor %}
  </dl>
{% endfor %}
service_plans

Returns the published service plans of the service

<p>We offer following service plans:</p>
<dl>
{% for service in model.services %}
  {% for service_plan in service.service_plans %}
    <dt>{{ service_plan.name }}</dt>
    <dd>{{ service_plan.system_name }}</dd>
  {% endfor %}
{% endfor %}
</dl>
plans

Returns the application plans of the service

features

Returns the visible features of the service

{% if service.features.size > 0 %}
  <p>{{ service.name }} has following features:</p>
  <ul>
  {% for feature in service.features %}
    <li>{{ feature.name }}</li>
  {% endfor %}
  </ul>
{% else %}
  <p>Unfortunately, {{ service.name }} currently has no features.</p>
{% endif %}
apps_identifier

Depending on the authentication mode set, returns either 'ID', 'API key' or 'Client ID' for OAuth authentication.

{{ service.application_key_name }}
backend_version
referrer_filters_required?
metrics

Returns the metrics of the service

<p>On {{ service.name }} we measure following metrics:</p>
<ul>
{% for metric in service.metrics %}
  <li>{{ metric.name }}</li>
{% endfor %}
</ul>
support_email

Support email of the service


ServiceContract drop (up)

Methods

errors

If a form of this model is rendered after unsuccesfull submit, this returns" errors that occured.

<input name="service_contract[name]"
       value="{{ service_contract.name }}"
       class="{{ service_contract.errors.name | error_class }}"/>
{{ service_contract.errors.name | inline_errors }}
id
can_change_plan?

Returns true if any form of change is possible

trial?

Returns true if the contract is still in the trial period.

Note: If you change the trial period length of a plan, it does not affect the existing contracts.

live?
state

There are three possible states:

    - pending
    - live
    - suspended
remaining_trial_period_days

Number of day still left in the trial period.

plan

Returns the plan of the contract

plan_change_permission_name

Returns name of the allowed action

plan_change_permission_warning

Returns a warning messenger of the allowed action

contract
name
system_name
change_plan_url
service
applications
can

Exposes specific rights of the current user for that subscription.

{% if subscription.can.change_plan? %}
  ...
{% endif %}

ServicePlan drop (up)

Methods

selected?

Returns whether the plan is selected

{% if plan.selected? %}
  <p>You will signup to {{ plan.name }}</p>
{% endif %}
bought?

Returns whether the plan is bought

{% if plan.bought? %}
   <p>You are  on this plan already!</p>
{% endif %}
features

Returns the visible features of the plan

{% if plan == my_free_plan %}
   <p>These plans are the same.</p>
{% else %}
   <p>These plans are not the same.</p>
{% endif %}
setup_fee

Returns the setup fee of the plan

name

Returns the name of the plan

<h2>We offer you a new {{ plan.name }} plan!</h2>
system_name

Returns the system name of the plan

{% for plan in available_plans %}
  {% if plan.system_name == 'my_free_plan' %}
    <input type="hidden" name="plans[system_name]" value="{{ plan.system_name }}"/>
    <p>You will buy our only free plan!</p>
  {% endif %}
{% endfor %}
id

Returns the plan id

free?

The plan is free if it is not 'paid' (see the 'paid?' method)

{% if plan.free? %}
   <p>This plan is free of charge.</p>
{% else %}
   <div>
     <p>Plan costs</p>
     <div>Setup fee {{ plan.setup_fee }}</div>
     <div>Flat cost {{ plan.flat_cost }}</div>
  </div>
{% endif %}
paid?

The plan is 'paid' when it has non-zero fixed or setup fee or there are some pricing rules present

{% if plan.paid? %}
   <p>this plan is a paid one.</p>
{% else %}
   <p>this plan is a free one.</p>
{% endif %}
approval_required?

Returns whether the plan requires approval?

{% if plan.approval_required? %}
   <p>This plan requires approval.</p>
{% endif %}
flat_cost

Returns the monthly fixed fee of the plan

service

Example: Using service plan drop in liquid

<p class="notice">The examples for plan drop apply here</p>
<div>Service of this plan {{ plan.service.name }}</div>

TimeZone drop (up)

Methods

full_name
to_str

Today drop (up)

Methods

month

Returns current month (1-12)

day

Returns current day of the month (1-31)

year

Returns current year Example: Create dynamic copyright

<span class="copyright">&copy;{{ today.year }}</span>
beginning_of_month

Returns date of beginning of current month

This month began on {{ today.beginning_of_month | date: '%A' }}

Topic drop (up)

Methods

errors

If a form of this model is rendered after unsuccesfull submit, this returns" errors that occured.

<input name="topic[name]"
       value="{{ topic.name }}"
       class="{{ topic.errors.name | error_class }}"/>
{{ topic.errors.name | inline_errors }}
title
kind
url
description

Topic drop (up)

Methods

errors

If a form of this model is rendered after unsuccesfull submit, this returns" errors that occured.

<input name="topic[name]"
       value="{{ topic.name }}"
       class="{{ topic.errors.name | error_class }}"/>
{{ topic.errors.name | inline_errors }}
title

Name of the topic. Submitted when first post to the thread is posted.

url

Url drop (up)

Methods

to_s
to_str
title
current_or_subpath?

True if the path of the current page is the same as this one or it's a 'direct subpath' of it (i.e. extended by ID). For example with {{ urls.outbox }} these will return true:

  • /admin/sent/messages/received
  • /admin/sent/messages/received/42

But not these:

  • /admin/sent/messsages/new
  • /admin/sent/messsages/longer/subpath

See also '#active?', '#current?'.

current?

True if the URL's path is the the same as of the current. Parameters and other components are not taken into account. See also '#active?'.

{% assign url = urls.messages_inbox %}
<!-- => http://awesome.3scale.net/admin/messages/sent -->

<!-- Current page: http://awesome.3scale.net/admin/messages/sent?unread=1 -->
{{ url.current? }} => true

<!-- Current page: http://awesome.3scale.net/admin/messages -->
{{ url.current? }} => false
active?

True if the current page is in the same menu structure as this URL. See also '#current?'.

{% assign url = urls.messages_inbox %}
<!-- => http://awesome.3scale.net/admin/messages/sent -->

<!-- Current page: http://awesome.3scale.net/admin/messages -->
{{ url.active? }} => true

<!-- Current page: http://awesome.3scale.net/admin/messages/trash -->
{{ url.active? }} => true

<!-- Current page: http://awesome.3scale.net/admin/stats -->
{{ url.active? }} => false

Urls drop (up)

Methods

provider
cas_login
<a href="{{ urls.signup }}">signup here</a>
<a href="{{ urls.service_subscription }}">subscribe to a service here</a>
new_application
signup

URL of a signup page. Accessible for all.

<a href="{{ urls.signup }}?{{ service_plan | param_filter }}&{{ app_plan | param_filter }}" >Signup Now!</a>
search

URL to which all the search requests should be sent

<form action="{{ urls.search }}" method="get">
  <input name="q" type="text" title="Search the site" value=""/>
  <input type="submit" value="Search" name="commit">
</form>
login
logout
forgot_password
service_subscription

URL to a service subscription page. Only for logged in users.

<a href="{{ urls.service_subscription }}?{{ service_plan | param_filter }}" >
  Subscribe to service {{ service.name }}
</a>
compose_message

URL to a page that allows the developer contact provider via the internal messaging system.

messages_outbox

URL to the list of messages sent by a developer.

messages_trash
empty_messages_trash
credit_card_terms
credit_card_privacy
credit_card_refunds
users
personal_details

URL or Nil if user account management is disabled (check your Usage rules).

access_details

A page with API key(s) and other authentication info. Differs depending on the authentication strategy.

payment_details
new_invitation

Page to invite new users

invitations

List of all the sent invitations

dashboard
applications
api_access_details
services
messages_inbox

URL to the list of received messages.

stats
account_overview
account_plans
invoices

UsageLimit drop (up)

Example: Using usage limit drop in liquid

You cannot do more than {{ limit.value }} {{ limit.metric.unit }}s per {{ limit.period }}

Methods

period

Returns the period of the usage limit

metric

Usually hits but can be any custom method.

value

Returns the value of the usage limit


User drop (up)

<h2>User {{ user.display_name }}</h2>
<div>Account {{ user.account.name }}</div>
<div>Username {{ user.username }}</div>
<div>Email {{ user.email }}</div>
<div>Website {{ user.website }}</div>

Methods

errors

If a form of this model is rendered after unsuccesfull submit, this returns" errors that occured.

<input name="user[name]"
       value="{{ user.name }}"
       class="{{ user.errors.name | error_class }}"/>
{{ user.errors.name | inline_errors }}
admin?

Returns whether the user is an admin.

{% if user.admin? %}
  <p>You are an admin of your account.</p>
{% endif %}
username

Returns the username of the user, html escaped.

account

Returns the account of the user.

name

Returns the first and surname of the user.

email

Returns the email of the user.

password_required?

This method will return true for users using the builtin Developer Portal authentication mechanisms and false for those that are authenticated via Janrain, CAS or other single-sign-on method.

{% if user.password_required? %}
  <input name="account[user][password]" type="password">
  <input name="account[user][password_confirmation]" type="password">
{% endif %}
sections

Returns the list of sections the user has access to.

{% if user.sections.size > 0 %}
  <p>You can access following sections of our portal:</p>
   <ul>
    {% for section in user.sections %}
      <li>{{ section }}</li>
    {% endfor %}
  </ul>
{% endif %}
role

Returns the role of the user

roles_collection

Retuns a list of available roles for the user

{% for role in user.roles_collection %}
  <li>
    <label for="user_role_{{ role.key }}">
      <input
        {% if user.role == role.key %}
          checked="checked"
        {% endif %}
      class="users_ids" id="user_role_{{ role.key }}" name="user[role]" type="radio" value="{{ role.key }}">
      {{ role.text }}
    </label>
    </li>
  {% endfor %}
url

Return the resource url of the user

{{ 'Delete' | delete_button: user.url }}
edit_url

Return the url to edit the user

{{ 'Edit' | link_to: user.edit_url, title: 'Edit', class: 'action edit' }}
can

Give access to permission methods

{% if user.can.be_managed? %}
  <!-- do something -->
{% endif %}
extra_fields

Returns non-hidden extra fields with values for this user Example: Print all extra fields

{% for field in user.extra_fields %}
  {{ field.label }}: {{ field.value }}
{% endfor %}
fields

Returns all fields with values for this user Example: Print all fields

{% for field in user.fields %}
  {{ field.label }}: {{ field.value }}
{% endfor %}
builtin_fields

Returns all builtin fields with values for this user


Tags (up)

Tag 'braintree_customer_form' (up)

Renders a form to enter data required for Braintree Blue payment gateway

Tag 'csrf' (up)

Renders the cross site request forgery meta tags.

Example: Using csrf tag in liquid

<html>
  <head>
    {% csrf %}
  </head>
</html>

Tag 'content' (up)

Renders body of a page. Use this only inside a layout.

Tag 'content_for' (up)

Tag 'debug' (up)

Prints all liquid variables available in a template into an HTML comment.' We recommend to remove this tag from public templates.

{% debug:help %}

Tag 'email' (up)

The email tag allows you to customize headers of your outgoing emails and is available only inside the email templates.

There are several convenience subtags such as cc or subject (see the table below) that simplify the job but you can also use a header subtag to set an arbitrary SMTP header for the message.

Subtag Description Example
subject dynamic subject {% subject = 'Greetings from Example company!' %}
cc carbon copy {% cc = 'boss@example.com' %}
bcc blind carbon copy {% bcc = 'all@example.com' %}
from the actual sender {% from = 'system@example.com' %}
reply-to {% reply-to = 'support@example.com' %}
header custom SMTP header {% header 'X-SMTP-Group' = 'Important' %}
do_not_send discard the email {% do_not_send %}

Example: Conditional blind carbon copy

{% email %}
  {% if plan.system_name == 'enterprise' %}
     {% bcc 'marketing@world-domination.org' %}
  {% endif%}
{% endemail %}

Example: Disabling emails at all

{% email %}
  {% do_not_send %}
{% endemail %}

Example: Signup email filter

{% email %}
  {% if plan.system == 'enterprise' %}
    {% subject = 'Greetings from Example company!' %}
    {% reply-to = 'support@example.com' %}
  {% else %}
    {% do_not_send %}
  {% endif %}
{% endemail %}

Tag 'flash' (up)

Renders informational or error messages of the system.

DEPRECATED: This tag is deprecated, use FlashDrop instead.

Example: Using flash tag in liquid

<html>
  <body>
   {% flash %}
  </body>
</html>

Tag 'footer' (up)

Renders a footer html snippet.

DEPRECATED: This tag is deprecated, use a CMS partial instead

Tag 'form' (up)

Renders a form tag with an action and class attribute specified, depending on the name of the form. The supported forms are:

Form Allowed Field Names Spam Protection Notes
application.create
  • application[name]
  • application[description]
  • application[<any-extra-field>]
No
application.update
  • application[name]
  • application[description]
  • application[<any-extra-field>]
No
signup
  • account[org_name]
  • account[org_legaladdress]
  • account[org_legaladdress_cont]
  • account[city]
  • account[state]
  • account[zip]
  • account[telephone_number]
  • account[country_id]
  • account[<any-extra-field>]
  • account[user][username]
  • account[user][email]
  • account[user][first_name]
  • account[user][last_name]
  • account[user][password]
  • account[user][password_confirmation]
  • account[user][title]
  • account[user][<any-extra-field>]
Yes Sign Up directly to plans of your choice by adding one one or more hidden fields with a name plan_ids[]. If a parameter of such name is found in the current URL, the input field is added automagically.

Example: A form to create an application

{% form 'application.create', application %}
   <input type='text' name='application[name]'
          value='{{ application.name }}'
          class='{{ application.errors.name | error_class }}'/>

   {{ application.errors.name | inline_errors }}

   <input name='commit'  value='Create!'>
{% endform %}

Tag 'latest_forum_posts' (up)

An HTML table with latest forum posts.

DEPRECATED: Use forum drop instead.

Example: Using latest_forum_posts tag liquid

{% latest_forum_posts %}

Tag 'latest_messages' (up)

Renders a html snippet with the latest messages for the user.

Example: Using latest_messages tag liquid

{% latest_messages %}

Tag 'logo' (up)

Renders the logo.

DEPRECATED: This tag is deprecated, use {{ provider.logo_url }} instead.

Example: Using menu tag in liquid

<html>
  <body>
   {% logo %}
  </body>
</html>

Tag 'menu' (up)

DEPRECATED: This tag is deprecated, use '{% include "menu" %}' instead.

Tag 'oldfooter' (up)

Renders a footer html snippet.

DEPRECATED: This tag is deprecated, use a CMS partial instead

Tag 'plan_widget' (up)

Includes a widget to review or change application plan

{% if application.can_change_plan? %}
  <a href="#choose-plan-{{ application.id }}"
     id="choose-plan-{{application.id}}">
    Review/Change
  </a>
  {% plan_widget application %}
{% endif %}

Tag 'portlet' (up)

This tag includes portlet by system name.

Tag 'submenu' (up)

Renders a submenu html snippet for a logged in user.

DEPRECATED: This tag is deprecated, use a 'submenu' partial instead

Example: Using submenu tag in liquid

<html>
  <body>
   {% submenu %}
  </body>
</html>

Tag '3scale_essentials' (up)

Tag 'user_widget' (up)

Renders a user widget html snippet.

DEPRECATED: This tag is deprecated, use a CMS partial instead

Example: Using user_widget tag in liquid

<html>
  <body>
   {% user_widget %}
    <p class="notice">If you are logged in you see profile related links above.</p>
    <p class="notice">If you are not login you are invited to login or signup.</p>
  </body>
</html>

Filters (up)

FormHelpers filters (up)

error_class filter

Outputs error class if argument is not empty Example: Using error_class to show output an error class

<input class="{{ form.errors.description | error_class }}" />

inline_errors filter

Outputs error fields inline in paragraph Example: Using inline_errors to show errors inline

{{ form.errors.description | inline_errors }}

ParamFilter filters (up)

to_param filter

Converts a supplied drop to URL parameter if possible. Example: Using to_param filter in liquid

<h2>Signup to a service</h2>
<a href="{{ urls.signup }}?{{ service | to_param }}">Signup to {{ service.name }}</a>

Common filters (up)

group_by filter

Group collection by some key Example: Group applications by service

{% assign grouped = applications | group_by: 'service' %}
{% for group in grouped %}
  Service: {{ group[0 }}
  {% for app in group[1] %}
    Application: {{ app.name }}
  {% endfor %}
{% endfor %}

any filter

True if any string in the collection equals to the parameter Example: Are there any pending apps of the current account?

{% assign has_pending_apps = current_account.applications | map: 'state' | any: 'live' %}

stylesheet_link_tag filter

Stylesheet link

javascript_include_tag filter

Javascript include tag

image_tag filter

Outputs an tag using the parameters as its src attribute.

{{ 'http://example.com/cool.gif' | image_tag }}
## => <img src="http://example.com/cool.gif" >

mail_to filter

Converts email address to a 'mailto' link.

{{ 'me@there.is' | mail_to }}
## => <a href="mailto:me@there.is">me@there.is</a>

html_safe filter

Marks content as HTML safe so that it is not escaped.

pluralize filter

Convert word to plural form

delete_button filter

Generates a button to delete a resource present on the URL. First parameter is a URL, second is a title. You can also add more HTML tag attributes as a third parameter.

{{ 'Delete Message' | delete_button: message.url, class: 'my-button' }}

delete_button_ajax filter

Generates a button to delete a resource present on the URL using AJAX. First parameter is a URL, second is a title.

{{ 'Delete Message' | delete_button_ajax: message.url }}

update_button filter

Generates a button to 'update' (HTTP PUT request) a resource present on the URL. First parameter is a URL, second is a title. You can also add more HTML tag attributes as a third parameter.

{{ 'Resend' | update_button: message.url, class: 'my-button' }}

create_button filter

Generates a button to create a resource present on the URL. First parameter is a URL, second is a title.

{{ 'Create Message' | create_button: message.url }}

create_button_ajax filter

regenerate_oauth_secret_button filter

link_to filter

Create link from given text

{{ "See your App keys" | link_to:'/my-app-keys' }}