Overview
Localist Events provides a comprehensive set of custom Liquid tags that extend the standard Liquid template language. These tags enable developers to render complex UI components, manage layouts, and access platform-specific functionality without writing custom plugins or Ruby code.
Custom tags follow standard Liquid syntax:
{% tag_name argument1 argument2 key:value %}
Some tags are block tags, which wrap content between an opening and closing tag:
{% block_tag %}
content here
{% endblock_tag %}
This reference catalogs all custom tags organized by function. Developers can copy examples directly into templates and customize parameters as needed.
Rendering and Partials
Tags for including external templates, capturing content blocks, and rendering stored snippets.
partial
Includes another template (partial) with optional data and local variables passed as arguments.
Syntax:
{% partial 'name' [with|using OBJECT] [as:alias] [key:value ...] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
name |
string | Path to the partial template (without .liquid extension) |
with OBJECT |
optional | Pass an object as the main context |
as:alias |
optional | Create a local variable alias for the object |
key:value |
optional | Pass additional key-value pairs as variables |
Description:
Renders a partial template with access to all parent variables plus any locally passed arguments. Useful for reusing template components like event cards, filters, or form sections.
Example:
{% partial 'events/event_card' with event class:'card' %}
This includes the events/event_card partial, passing the event object and a class variable set to 'card'.
yield
Outputs a named content block passed from a layout or page.
Syntax:
{% yield [NAME] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
NAME |
optional | Name of the content block to yield (default: main content) |
Description:
Typically used in layout templates to render the content injected by child templates using content_for. If no name is given, yields the default layout content.
Example:
{% yield head %}
This outputs content that was captured in a content_for head block by a child template.
content_for (block tag)
Captures content into a named block for injection into the layout.
Syntax:
{% content_for NAME %}
content
{% endcontent_for %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
NAME |
string | Name of the block (e.g., scripts, head, sidebar) |
Description:
A block tag that captures any content between the opening and closing tags and stores it under a named block. The layout can then output this content using {% yield NAME %}.
Example:
{% content_for scripts %}
<script src="custom.js"></script>
{% endcontent_for %}
snippet
Renders a stored platform snippet by key.
Syntax:
{% snippet KEY [var:value ...] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
KEY |
string | Snippet key (often from i18n/configuration) |
var:value |
optional | Variables to pass to the snippet |
Description:
Retrieves and renders a pre-defined platform snippet (e.g., UI strings, widget templates) by key. Useful for rendering configurable text, labels, and UI elements.
Example:
{% snippet event_action_buttons.going.label %}
Event Display Tags
Tags for rendering event data, event cards, and event-related UI components.
render_event_item
Renders an event item card with configurable date/time formatting and display options.
Syntax:
{% render_event_item EVENT [date_format:FMT] [time_format:FMT] [size:SIZE] [show_other_instances:BOOL] [order:FIELDS] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
EVENT |
object | Event object to render |
date_format:FMT |
optional | Date format string (e.g., '%b %d') |
time_format:FMT |
optional | Time format string (e.g., '%I:%M %p') |
size:SIZE |
optional | Card size: 'small', 'medium', 'large'
|
show_other_instances:BOOL |
optional | Show other instances of recurring events |
order:FIELDS |
optional | Field display order |
Description:
Renders a complete event card with photo, title, date/time, location, and action buttons. Includes filtering and attendance indicators.
Example:
{% render_event_item event date_format:'%b %d' size:'small' %}
event_time
Displays formatted event start and end times with optional timezone support.
Syntax:
{% event_time OBJECT [date_format:FMT] [time_format:FMT] [separator:STR] [time_zone:BOOL] [order:FIELDS] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
OBJECT |
object | Event or event instance object |
date_format:FMT |
optional | Date format string |
time_format:FMT |
optional | Time format string |
separator:STR |
optional | Separator between start and end time (default: ' - ') |
time_zone:BOOL |
optional | Include timezone in output |
order:FIELDS |
optional | Field ordering |
Description:
Renders a formatted time range for an event. Can format and display both start and end times separately or as a range.
Example:
{% event_time instance time_zone:yes separator:' - ' %}
event_filters
Renders event type or tag filter links.
Syntax:
{% event_filters EVENT [wrapper:TAG] [divider:STR] [only_leaf_types:BOOL] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
EVENT |
object | Event object |
wrapper:TAG |
optional | HTML tag to wrap each filter (e.g., 'span') |
divider:STR |
optional | String between filters |
only_leaf_types:BOOL |
optional | Show only leaf types in taxonomy |
Description:
Renders clickable filter links for the event’s types and tags. Useful for category/tag cloud displays.
Example:
{% event_filters event only_leaf_types:true %}
event_action_buttons
Renders action buttons for an event (attend, share, watch, etc.).
Syntax:
{% event_action_buttons EVENT %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
EVENT |
object | Event object |
Description:
A convenience tag that renders the standard action button set for an event in the default configuration. Includes buttons for attending, sharing, and other event-specific actions.
Example:
{% event_action_buttons event %}
event_interest_button
Renders the interest or attendance toggle button for an event.
Syntax:
{% event_interest_button EVENT [invitation:VAR] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
EVENT |
object | Event object |
invitation:VAR |
optional | Invitation variable for RSVP workflows |
Description:
Renders a toggle button that allows users to mark interest or confirm attendance for an event. Can be customized with invitation context.
Example:
{% event_interest_button event invitation:invitation %}
event_action_url
Generates a URL for an event action (confirm attendance, watch event, etc.).
Syntax:
{% event_action_url ACTION [for] EVENT %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
ACTION |
string | Action name (e.g., 'confirm', 'watch', 'unwatch') |
for EVENT |
object | Target event object |
Description:
Outputs a URL for a specific event action without rendering a button. Useful for custom button or link implementations.
Example:
{% event_action_url confirm for event %}
event_knowledge_graph_tag
Outputs structured data (JSON-LD) for search engine optimization.
Syntax:
{% event_knowledge_graph_tag EVENT %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
EVENT |
object | Event object |
Description:
Renders JSON-LD structured data for the event, enabling search engines to understand event details (name, date, location, image, etc.) for rich snippets in search results.
Example:
{% event_knowledge_graph_tag event %}
attendance_text
Renders contextual text about attendance (e.g., “2 friends going”).
Syntax:
{% attendance_text event:EVENT named:NAME count:N %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
event:EVENT |
object | Event object |
named:NAME |
string | Label for named attendees (e.g., 'friend', 'colleague') |
count:N |
integer | Count of attendees to display |
Description:
Renders human-readable attendance text, useful for social proof elements like “3 friends going” or “5 colleagues attending”.
Example:
{% attendance_text event:event named:friend count:2 %}
Channel Page Tags
Tags for rendering channel page layouts and components.
channel_page_components (alias: components)
Renders all components for a channel page column.
Syntax:
{% channel_page_components CHANNEL_PAGE [column:N] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
CHANNEL_PAGE |
object | Channel page object |
column:N |
optional | Column index (0-based, default: 0) |
Description:
A convenience tag that renders all configured components for a specific column of a channel page. Respects component visibility and ordering settings.
Example:
{% channel_page_components channel_page column:0 %}
render_channel_page_component
Renders a single channel page component.
Syntax:
{% render_channel_page_component COMPONENT [visible:BOOL] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
COMPONENT |
object | Component object from a channel page |
visible:BOOL |
optional | Override visibility setting |
Description:
Renders an individual component from a channel page with support for conditional visibility.
Example:
{% render_channel_page_component component visible:true %}
Time and Date Tags
Tags for formatting and displaying dates and times.
format_time (alias: local_time_tag)
Formats a time or time range with optional formatting options.
Syntax:
{% format_time START [[to] END] [format:FMT] [date_only:BOOL] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
START |
datetime | Start time/date |
to END |
optional | End time/date for range display |
format:FMT |
optional | Format preset: 'compact', 'detailed', etc. |
date_only:BOOL |
optional | Show only the date, omit time |
Description:
A flexible time formatting tag that can display a single time, a time range, or just a date. Format options follow platform conventions.
Example:
{% format_time starts_at to ends_at format:compact %}
format_event_time (alias: local_event_time_tag)
Formats an event’s complete date and time range.
Syntax:
{% format_event_time EVENT [format:FMT] [date_only:BOOL] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
EVENT |
object | Event object |
format:FMT |
optional | Format preset: 'compact', 'detailed', etc. |
date_only:BOOL |
optional | Show only dates |
Description:
Renders the full date and time range for an event, respecting the event’s start and end times and applying the specified format.
Example:
{% format_event_time event format:detailed %}
formatted_date_range
Renders a human-readable date range string.
Syntax:
{% formatted_date_range START [to] END %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
START |
date | Start date |
to END |
date | End date |
Description:
Outputs a formatted date range in a human-friendly format, e.g., “January 15 - 20, 2026”.
Example:
{% formatted_date_range start_date to end_date %}
recent_date
Renders a relative date (e.g., “Today”, “Yesterday”) or formatted past date.
Syntax:
{% recent_date DATE [format:FMT] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
DATE |
datetime | Date to display |
format:FMT |
optional | Fallback format string if date is not recent |
Description:
Shows relative date names (“Today”, “Yesterday”) for recent dates, or formats older dates using the provided format string.
Example:
{% recent_date updated_at format:'%Y-%m-%d' %}
Calendar Tags
Tags for rendering calendar widgets and date grids.
minicalendar
Renders a mini calendar widget with optional active date highlighting.
Syntax:
{% minicalendar [title:STR] [active:DATES] [day:DATE] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
title:STR |
optional | Calendar title |
active:DATES |
optional | Array of dates to highlight as active |
day:DATE |
optional | Initial day to display |
Description:
Renders a standalone mini calendar widget, often used in sidebars. Dates in the active array are highlighted to indicate event days.
Example:
{% minicalendar title:'Events' active:active_dates %}
calendar_grid (block tag)
Renders a month grid where the block body is repeated for each day cell.
Syntax:
{% calendar_grid DAY [key:value ...] %}
content per day
{% endcalendar_grid %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
DAY |
date | Reference date to determine the month |
key:value |
optional | Additional configuration options |
Description:
A block tag that iterates over each day in a calendar month. Within the block, variables like day, date, and events are available for the current cell. Useful for custom calendar layouts.
Example:
{% calendar_grid today %}
<span>{{ day }}</span>
{% endcalendar_grid %}
minicalendar_grid
Renders a compact calendar grid for a given month.
Syntax:
{% minicalendar_grid DAY %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
DAY |
date | Reference date to determine the month |
Description:
A convenience tag that renders a pre-styled compact calendar grid. Typically smaller and more minimal than a full calendar.
Example:
{% minicalendar_grid today %}
calendar_header_text
Renders the calendar header text with optional type filtering.
Syntax:
{% calendar_header_text NAME [TYPES] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
NAME |
string | Name/locality to display |
TYPES |
optional | Event types to filter by |
Description:
Renders a formatted header for a calendar view, optionally filtered by event type.
Example:
{% calendar_header_text locality_name event_types %}
Navigation and URL Tags
Tags for generating URLs, links, and breadcrumb trails.
relative_url
Generates a URL merging given parameters with the current request parameters.
Syntax:
{% relative_url [param:value ...] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
param:value |
optional | URL parameters to set or override |
Description:
Outputs a URL that preserves existing request parameters and merges in new ones. Useful for pagination, filtering, and view switching without losing context.
Example:
{% relative_url view:month year:2026 %}
relative_calendar_link
Renders an anchor link to the current calendar view.
Syntax:
{% relative_calendar_link LABEL [class:CSS] [key:value ...] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
LABEL |
string | Link text |
class:CSS |
optional | CSS class(es) for the link |
key:value |
optional | Additional HTML attributes |
Description:
Creates a link to the current calendar view (preserving filters, view mode, date, etc.).
Example:
{% relative_calendar_link 'Calendar' class:'cal-link' %}
relative_calendar_url
Outputs the URL for the current calendar view.
Syntax:
{% relative_calendar_url %}
Parameters:
None
Description:
Outputs just the URL (without wrapping in an anchor tag) for the current calendar view.
Example:
{% relative_calendar_url %}
relative_browse_link
Renders a link to browse a resource type (places, groups, departments).
Syntax:
{% relative_browse_link LABEL WHAT [key:value ...] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
LABEL |
string | Link text |
WHAT |
string | Resource type: 'businesses', 'groups', 'departments', etc. |
key:value |
optional | Additional options (filters, classes) |
Description:
Creates a link to a browseable index of a resource type (e.g., places, departments, groups).
Example:
{% relative_browse_link 'Places' businesses %}
relative_browse_url
Outputs a browse URL for a resource type.
Syntax:
{% relative_browse_url WHAT [key:value ...] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
WHAT |
string | Resource type to browse |
key:value |
optional | Additional filters or options |
Description:
Outputs the URL (without wrapping in an anchor tag) for browsing a resource type.
Example:
{% relative_browse_url groups %}
relative_search_url
Outputs a search URL for a resource type.
Syntax:
{% relative_search_url WHAT [key:value ...] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
WHAT |
string | Resource type to search (e.g., 'departments', 'places') |
key:value |
optional | Search filters or options |
Description:
Generates a URL for searching a specific resource type.
Example:
{% relative_search_url departments %}
search_url
Generates a search URL with optional filters and pagination.
Syntax:
{% search_url QUERY [what:TYPE] [page:N] [past:BOOL] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
QUERY |
string | Search query string |
what:TYPE |
optional | Resource type (e.g., 'events', 'places') |
page:N |
optional | Page number for pagination |
past:BOOL |
optional | Include past events in results |
Description:
Generates a complete search URL with query, filters, and pagination parameters.
Example:
{% search_url query what:events %}
feed_url
Outputs the feed URL for the specified format.
Syntax:
{% feed_url FORMAT %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
FORMAT |
string | Feed format: 'ics', 'rss', 'atom', etc. |
Description:
Generates a feed subscription URL in the requested format.
Example:
{% feed_url ics %}
page_url
Generates a URL to a specific page number.
Syntax:
{% page_url PAGE_NUM %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
PAGE_NUM |
integer or variable | Page number (can use variables like next_page) |
Description:
Outputs a URL for a paginated view at the specified page number.
Example:
{% page_url next_page %}
breadcrumbs (block tag)
Renders a breadcrumb trail with nested link tags.
Syntax:
{% breadcrumbs %}
content with links
{% endbreadcrumbs %}
Parameters:
None
Description:
A block tag that wraps breadcrumb content. Typically contains multiple {% link %} tags to render the breadcrumb trail.
Example:
{% breadcrumbs %}
{% link home %}
{% link event url:event.url %}{{ event.name }}{% endlink %}
{% endbreadcrumbs %}
Pagination Tags
Tags for handling paginated collections and page navigation.
pagination_for (block tag)
Wraps a paginated collection, exposing page navigation variables inside the block.
Syntax:
{% pagination_for COLLECTION [size:N] [outer_window:N] %}
paginated content
{% endpagination_for %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
COLLECTION |
array | Collection to paginate |
size:N |
optional | Items per page (default: 10) |
outer_window:N |
optional | Number of page links to show on edges |
Description:
A block tag that sets up pagination for a collection. Inside the block, the collection is available with pagination metadata. Page navigation tags like page_numbers and next_page_button can be used within the block.
Example:
{% pagination_for events size:10 %}
{% for event in events %}
{% render_event_item event %}
{% endfor %}
{% page_numbers events %}
{% next_page_button events %}
{% endpagination_for %}
next_page_link
Renders a “load more” link for AJAX-style pagination.
Syntax:
{% next_page_link OBJECT [num:N] [what:LABEL] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
OBJECT |
object | Paginated collection object |
num:N |
optional | Number of items to load |
what:LABEL |
optional | Label for items (e.g., 'events') |
Description:
Renders a “Load More” or similar link that can be used with AJAX to fetch the next page of results.
Example:
{% next_page_link activities %}
next_page_button
Renders a “next page” navigation button.
Syntax:
{% next_page_button COLLECTION %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
COLLECTION |
object | Paginated collection |
Description:
Renders a styled “Next” button for moving to the next page of results.
Example:
{% next_page_button events %}
previous_page_button
Renders a “previous page” navigation button.
Syntax:
{% previous_page_button COLLECTION %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
COLLECTION |
object | Paginated collection |
Description:
Renders a styled “Previous” button for moving to the previous page of results.
Example:
{% previous_page_button events %}
page_numbers
Renders numbered page links for a paginated collection.
Syntax:
{% page_numbers COLLECTION [size:N] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
COLLECTION |
object | Paginated collection |
size:N |
optional | Number of page links to display |
Description:
Renders a set of numbered page links (e.g., “1 2 3 4 5”) for direct page navigation.
Example:
{% page_numbers events size:4 %}
Form Tags
Tags for rendering form elements and form structure.
form_for (block tag)
Opens a form bound to an object with support for method, URL, multipart, and HTML attributes.
Syntax:
{% form_for OBJECT [method:URL] [url:PATH] [multipart:BOOL] [as:NAME] [remote:BOOL] [html attrs] %}
form fields
{% endform_for %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
OBJECT |
object | Model object (e.g., event, user) |
method:URL |
optional | Form method (default: POST) |
url:PATH |
optional | Form submission URL |
multipart:BOOL |
optional | Enable file uploads (multipart/form-data) |
as:NAME |
optional | Parameter name prefix for fields |
remote:BOOL |
optional | Submit via AJAX |
html attrs |
optional | Standard HTML attributes (id, class, data-*) |
Description:
A block tag that opens a form and binds it to an object. All field tags within the block automatically use the object’s attributes. The form tag handles CSRF protection, method handling, and HTML rendering.
Example:
{% form_for event multipart:true %}
{% text_field title class:'input' %}
{% text_area_field description rows:5 %}
<button type="submit">Save</button>
{% endform_for %}
form_header
Renders a form section heading with optional tooltip.
Syntax:
{% form_header 'HEADING' [tooltip:TEXT] [tooltip_url:URL] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
HEADING |
string | Section heading text |
tooltip:TEXT |
optional | Tooltip text on hover |
tooltip_url:URL |
optional | URL for detailed help |
Description:
Renders a styled section heading for organizing form fields into logical groups. Tooltips provide contextual help.
Example:
{% form_header 'Event Details' %}
form_row (block tag)
Wraps a form field in a labeled row.
Syntax:
{% form_row 'LABEL' [tooltip:TEXT] %}
form field
{% endform_row %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
LABEL |
string | Field label |
tooltip:TEXT |
optional | Tooltip text |
Description:
A block tag that wraps a form field with a label and consistent layout styling.
Example:
{% form_row 'Event Name' %}
{% text_field title %}
{% endform_row %}
admin_row (block tag)
Wraps a form field in an admin-styled labeled row.
Syntax:
{% admin_row 'LABEL' [tooltip:TEXT] %}
form field
{% endadmin_row %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
LABEL |
string | Field label |
tooltip:TEXT |
optional | Tooltip text |
Description:
Similar to form_row but with admin-specific styling. Used in administrative interfaces.
Example:
{% admin_row 'Status' %}
{% collection_select status from status_options %}
{% endadmin_row %}
form_block
Renders a form section heading (alias for form_header).
Syntax:
{% form_block 'HEADING' %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
HEADING |
string | Section heading text |
Description:
A convenience alias for form_header. Renders a section heading to organize form fields.
Example:
{% form_block 'Location' %}
form_group (block tag)
Groups form fields under a labeled section.
Syntax:
{% form_group 'LABEL' [tooltip:TEXT] %}
form fields
{% endform_group %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
LABEL |
string | Group label |
tooltip:TEXT |
optional | Tooltip text |
Description:
A block tag that wraps multiple form fields under a labeled section with visual grouping.
Example:
{% form_group 'Contact Info' %}
{% text_field email %}
{% text_field phone %}
{% endform_group %}
text_field
Renders a text input bound to the form object’s attribute.
Syntax:
{% text_field ATTRIBUTE [class:CSS] [placeholder:TEXT] [key:value ...] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
ATTRIBUTE |
string | Object attribute name (e.g., title, email) |
class:CSS |
optional | CSS class(es) |
placeholder:TEXT |
optional | Placeholder text |
key:value |
optional | Additional HTML attributes |
Description:
Renders a standard text input field bound to an attribute of the form object.
Example:
{% text_field title class:'input' placeholder:'Enter title' %}
text_area_field
Renders a textarea bound to the form object’s attribute.
Syntax:
{% text_area_field ATTRIBUTE [rows:N] [key:value ...] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
ATTRIBUTE |
string | Object attribute name |
rows:N |
optional | Number of rows to display |
key:value |
optional | Additional HTML attributes |
Description:
Renders a multi-line text input field for longer text content.
Example:
{% text_area_field description rows:5 %}
check_box_field
Renders a checkbox bound to the form object’s attribute.
Syntax:
{% check_box_field ATTRIBUTE [key:value ...] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
ATTRIBUTE |
string | Object attribute name (typically boolean) |
key:value |
optional | Additional HTML attributes |
Description:
Renders a checkbox input field for boolean attributes.
Example:
{% check_box_field sponsored %}
file_field
Renders a file input bound to the form object’s attribute.
Syntax:
{% file_field ATTRIBUTE [key:value ...] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
ATTRIBUTE |
string | Object attribute name |
key:value |
optional | Additional HTML attributes (e.g., accept:'image/*') |
Description:
Renders a file upload input field.
Example:
{% file_field photo %}
password_field
Renders a password input bound to the form object’s attribute.
Syntax:
{% password_field ATTRIBUTE [key:value ...] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
ATTRIBUTE |
string | Object attribute name |
key:value |
optional | Additional HTML attributes |
Description:
Renders a masked password input field.
Example:
{% password_field password %}
hidden_field
Renders a hidden input bound to the form object’s attribute.
Syntax:
{% hidden_field ATTRIBUTE [value:VAL] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
ATTRIBUTE |
string | Object attribute name |
value:VAL |
optional | Override the field value |
Description:
Renders a hidden input field, commonly used for CSRF tokens or object IDs.
Example:
{% hidden_field event_id value:event.id %}
collection_select
Renders a select dropdown from a collection (inside form_for).
Syntax:
{% collection_select ATTRIBUTE from COLLECTION [labels:FIELD] [values:FIELD] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
ATTRIBUTE |
string | Object attribute name to bind to |
from COLLECTION |
array | Array of options to populate the select |
labels:FIELD |
optional | Field name to use for display labels |
values:FIELD |
optional | Field name to use for option values |
Description:
Renders a select dropdown populated from a collection (array of objects). Must be used inside form_for.
Example:
{% collection_select category from categories %}
collection_select_tag
Renders a standalone select dropdown (outside form_for).
Syntax:
{% collection_select_tag 'NAME' from COLLECTION [key:value ...] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
NAME |
string | HTML name attribute for the field |
from COLLECTION |
array | Array of options |
key:value |
optional | Additional HTML attributes |
Description:
A standalone version of collection_select for use outside of a form context.
Example:
{% collection_select_tag 'type' from types %}
preference_checkbox
Renders a checkbox for a platform preference setting.
Syntax:
{% preference_checkbox 'PREF_NAME' %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
PREF_NAME |
string | Preference name (e.g., 'email_notifications') |
Description:
Renders a checkbox bound to a user preference setting on the platform.
Example:
{% preference_checkbox 'email_notifications' %}
rich_text_area
Renders a rich text editor bound to a field.
Syntax:
{% rich_text_area ATTRIBUTE [value:VAL] [key:value ...] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
ATTRIBUTE |
string | Object attribute name |
value:VAL |
optional | Pre-populate the editor |
key:value |
optional | Additional options |
Description:
Renders a WYSIWYG rich text editor (e.g., TinyMCE) for HTML/formatted text content.
Example:
{% rich_text_area description %}
date_select_tag
Renders date select dropdowns (month/day/year).
Syntax:
{% date_select_tag [name:NAME] [attribute:ATTR] [order:FIELDS] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
name:NAME |
optional | HTML name prefix (e.g., 'user' → user[month], etc.) |
attribute:ATTR |
optional | Attribute name within the named object |
order:FIELDS |
optional | Field order (e.g., 'month,day,year') |
Description:
Renders three select dropdowns for month, day, and year selection. Useful for birthday or date fields.
Example:
{% date_select_tag name:'user' attribute:'birthday' order:'month,day,year' %}
friend_select_tag
Renders an autocomplete select for choosing friends/users.
Syntax:
{% friend_select_tag NAME [class:CSS] [key:value ...] %}
Parameters:
| Parameter | Type | Description |
|---|---|---|
NAME |
string | HTML name attribute |
class:CSS |
optional | CSS class(es) |
key:value |
optional | Additional HTML attributes |
Description:
Renders a searchable autocomplete select field for selecting users or friends from the platform.
Example:
{% friend_select_tag place_name class:'select' %}
Related Articles
This article is part of an 8-part series on Localist developer theming: