Skip to main content
Link
Menu
Expand
(external link)
Document
Search
Copy
Copied
Custom Sites
Home
Get Started
Set Up Your Weebly for Web Designers Account
Manage Access to the Square Online Dashboard
Set Up Your Square Account
Manage Access to Square APIs
Choose Existing or New Site Development Option
Guides
Site Architecture
Site Directory
Theme Directory
Page Rendering
Page Templates
Section Templates
System Pages
Code Editor Overview
Theme Performance
Theme Configs
Config Variables
Theme Cache Configs
Global Sections
How Tos
Create a Page
Implement Customer Accounts
Display Items
Use Resources
Use Editor Controls
Use Submission Forms
Localization
-----------
Square Online CLI Reference
Sites API Reference
List Sites
Create Theme
Upsert Theme File
List Theme Files
Delete Theme File
Create Site Page
Update Site Page
List Site Pages
Get Site Page
Delete Site Page
Upsert Site Setting
List Site Settings
Delete Site Setting
Upsert Global Element
List Global Elements
Delete Global Element
-----------
Site
SiteGlobalElement
SiteGlobalElementType
SitePage
SiteSetting
Theme
ThemeFile
Error
-----------
Template Syntax Reference
Tags
form
item_form
paginate
schema
Twig Tags
Filters
asset_url
asset_full_url
stylesheet_tag
localize
srcset
sizes
color_adjust
color_darken
color_lighten
color_contrast
color_contrast_ratio
color_neutral
color_alpha
color_is_dark
color_luminance
array_average
array_collapse
array_combine
array_concat
array_diff
array_duplicates
array_first_where
array_flip
array_keys
array_max
array_median
array_merge
array_merge_recursive
array_min
array_pluck
array_random
array_shuffle
array_values
array_where
array_where_between
array_where_not_between
array_where_in
address_format
array_where_not_in
address_format_multiline
array_where_null
array_where_not_null
global_selected_style
format_price
format_phone_number
global_selected_style_system_color
global_selected_style_color
Twig Filters
Data Types
Basics
Functions
Twig Functions
body_trackers
cart
category
category_hierarchy
category_link
category_list
category_options
consent_purpose
custom_page_link
customer_account
customer_account_url
customer_accounts_login
head_trackers
inject_registered_assets
item
item_link
item_list
link
location
location_courier_quote_list
location_list
loyalty_program
page_link
paginate_meta
popular_items
register_asset
resource
resources
similar_items
store_info
supported_image_sizes
video
Bootstrapped Resources Reference
Site Styles
Resources Reference
Cart
Category
CategoryHierarchy
CategoryList
CategoryOptions
CustomerAccount
DiscountList
Image
Item
ItemList
Link
Location
LocationCourierQuoteList
LocationList
LoyaltyProgram
ScheduleDays
ScheduleTimes
StoreInfo
Video
Editor Controls Reference
Background Selector
Button Group
Button Reset
Category List Chooser
Checkbox
Color Chooser
Control Icons
Global Panel Link
Group
Group List
Group Toggle
Image Chooser
Input
Item List Chooser
Link Chooser
Link button
Message
Notice
Option Cards
Radio Group
Select
Slider
Stepper
Textarea
Toggle
Video Chooser
Site Theme SDK Reference
Item Helpers
Variation Choices
Modifier Validation
Item Validation
Item Price
Item Unavailable
Money Helpers
Cart API
Add Item
Attach Loyalty Reward
Clear
Get Active Id
Remove Loyalty Reward
Buy Now Item
Remove Item
Update Item Quantity
Put Fulfillment
Resources API
Places API
Autocomplete Places
Get Place
Template API
Customers API
Get Coordinates
Get Loyalty Account
Client APIs Reference
Template API
Resources API
Cart API
buy
add
remove-item
update-quantity
fulfillment
attach-loyalty-reward
remove-loyalty-reward
-----------
FAQs
Changelog
Breaking Changes
Async Function Removal
Breaking Changes - System pages
Category Square Online ID
Disable Store and Settings Resource Bootstrap
Group control `children` prop
Item Subscription Discounts
Localization
LocationCourierQuotes to LocationCourierQuoteList
Patch to Put Fulfillment
Remove `orders` from SDK
Remove category availability time add/subtract filters
Rename "option" to "control" in editor config
Resource API to Resources API
Resource percentages, customer account ID string, and item subscription account rename
Resource product to item property renames
Resources
Resources IDs
Square Online SDK rename to Site Theme SDK
Twig Filters
Template Syntax Reference
Filters
array_random
array_random Filter
Returns a random item from the array
{{
[
1
,
2
,
3
]
|
array_random
}}
{# 2 - retrieved randomly #}