

  

[{"category":"variable","deprecated":false,"deprecation_reason":"","description":"You can create variables of any [basic type](/docs/api/liquid/basics#types), [object](/docs/api/liquid/objects), or object property.","parameters":[],"summary":"Creates a new variable.","name":"assign","syntax":"{% assign variable_name = value %}","syntax_keywords":[{"keyword":"variable_name","description":"The name of the variable being created."},{"keyword":"value","description":"The value you want to assign to the variable."}],"examples":[{"name":"","description":"","syntax":"","path":"/products/health-potion","raw_liquid":"{%- assign product_title = product.title | upcase -%}\n\n{{ product_title }}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"platformOS","deprecated":false,"deprecation_reason":"","deprecation_replacement":"","description":"Invokes code within the tag asynchronously, in the background.\nYou will only have access to variables you explicitly pass to the background tag. The context object is available by default, but with limitations - you need\nto explicitly pass page/layout metadata if you want to use it, as well as device and constants.","syntax":"background job_id = 'path/to/partial', delay: 0.1, max_attempts: 3, source_name: 'custom_job', arg0: data","platformOS":true,"name":"background","parameters":[{"description":"Any variable provided to the background tag will become accessible in the code.","name":"options","required":false,"types":["object"],"array_value":""},{"description":"which defines the number of minutes to delay running code (defaults to 0, which means run code as soon as\npossible)","name":"options.delay","required":false,"types":["number"],"array_value":""},{"description":"low, default or high - see AsyncCallbackPriorityEnum GraphQL Object","name":"options.priority","required":false,"types":["string"],"array_value":""},{"description":"the number of time to re-try job upon failing. Default is 1, maximum is 5","name":"options.max_attempts","required":false,"types":["number"],"array_value":""},{"description":"your label of the job, which would help you identify it","name":"options.source_name","required":false,"types":["string"],"array_value":""}],"return_type":[],"examples":[{"name":"","description":"","syntax":"","path":"","raw_liquid":"Run background code from partial\nThe following code will run all the log queries in the background, not earlier than 0.5 minute (30 seconds) since the execution. You will only have access to variables\nexplicitly provided to the background tag: \"data\" and \"hey\". Note that you will not have access to the \"my_data\" variable. Also note\nthat the result of this background tag will not be rendered, and you will not have access to any variable inside the background tag.\n\n# app/views/partials/example_partial.liquid\n{% liquid\n  log not_available_in_background  # Will be null, as this variable was not passed to the background tag\n  log data                         # You will see { \"hello\": \"world\" }, as it was provided to the background tag\n  log hey                          # You will see \"hello\" as it was provided to the background tag\n  log context                      # You will copy the current request context and make it available in the background\n  assign not_available_outside = \"You will not see me\"\n\n%}\n\n# app/views/pages/test.liquid\n{% liquid\n  assign my_data = null | hash_merge: hello: \"world\"\n  assign not_available_in_job = \"You will not see me \"\n  background job_id = 'example_partial', delay: 0.1, max_attempts: 3, source_name: 'custom_job', data: my_data, hey: 'hello'\n\n  # This variable will be rendered in the background, meaning you won't see anything on the page\n  echo not_available_outside\n%}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"Deprecated\nThe following code will run all the log queries in the background, not earlier than 0.5 minute (30 seconds) since the execution. You will only have access to variables\nexplicitly provided to the background tag: \"data\" and \"hey\". Note that you will not have access to the \"my_data\" variable. Also note\nthat the result of this background tag will not be rendered, and you will not have access to any variable inside the background tag.\n\n{% assign my_data = { \"hello\": \"world\" } %}\n{% assign not_available_in_background = \"You will not see me\" %}\n{% background priority: 'low', delay: 0.5, max_attempts: 3, source_name: \"my custom job\", data: my_data, hey: 'hello' %}\n  {% log not_available_in_background %} {% comment %}Will be null, as this variable was not passed to the background tag {% endcomment %}\n  {% log data %} {% comment %}You will see { \"hello\": \"world\" }, as it was provided to the background tag{% endcomment %}\n  {% log hey %} {% comment %}You will see \"hello\" as it was provided to the background tag{% endcomment %}\n  {% log context %} {% comment %}You will copy the current request context and make it available in the background{% endcomment %}\n  {% assign not_available_outside = \"You will not see me\" %}\n  {{ not_available_outside }} {% comment %}This variable will be rendered in the background, meaning you won't see anything on the page{% endcomment %}\n{% endbackground %}\n{{ not_available_outside }} {% comment %}This will be blank, because the assign will happen in the background - you won't have access to it here{% endcomment %}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"iteration","deprecated":false,"deprecation_reason":"","description":"","parameters":[],"summary":"Stops a [`for` loop](/docs/api/liquid/tags/for) from iterating.","name":"break","syntax":"{% break %}","syntax_keywords":[],"examples":[{"name":"","description":"","syntax":"","path":"/","raw_liquid":"{% for i in (1..5) -%}\n  {%- if i == 4 -%}\n    {% break %}\n  {%- else -%}\n    {{ i }}\n  {%- endif -%}\n{%- endfor %}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"platformOS","deprecated":false,"deprecation_reason":"","deprecation_replacement":"","description":"Checks if there's string cached for the given key. If yes, it just returns the value without processing\nanything inside the cache tag, otherwise it executes code, stores the result in the cache.\nWhen you hit the page with such code for the first time, the code will be executed and hence it will iterate through the loop\nand generate random strings. However, then the result of the block will be cached and all the following requests within 20 seconds\nwould not invoke the code - instead, it would just take the value from the cache. The output will not change. When the cache expires,\nthe code will be evaluated again, producing another set of random string.\nCache is automatically invalidated if any changes are applied to any view/translation.","syntax":"{% cache 'this is my key', expire: 20 %}\n\n{% endcache %}","platformOS":true,"name":"cache","parameters":[{"description":"the key which should uniquely identify the cached fragment","name":"key","required":false,"types":["string"],"array_value":""},{"description":"optional. number of seconds since populating the cache to expiration","name":"expire","required":false,"types":["number"],"array_value":""}],"return_type":[],"examples":[{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% cache 'this is my key', expire: 20 %}\n  \u003cul\u003e\n    {% for i in (1..100) %}\n      \u003cli\u003e{{ 18 | random_string }}\u003c/li\u003e\n    {% endfor %}\n  \u003c/ul\u003e\n{% endcache %}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"{%- capture pagesUpdatedAtJson -%}\n  {%- cache pagesUpdatedAtCache -%}\n    {%- graphql g = 'pages_updated_at' | dig: 'admin_pages', 'results' -%}\n    {{- g -}}\n  {%- endcache -%}\n{%- endcapture -%}\n{%- assign pagesUpdatedAt = pagesUpdatedAtJson | parse_json -%}\n{%- export pagesUpdatedAt, namespace: 'nav' -%}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"variable","deprecated":false,"deprecation_reason":"","description":"You can create complex strings with Liquid logic and variables.","parameters":[],"summary":"Creates a new variable with a string value.","name":"capture","return_type":[{"type":"string","name":"","description":"The rendered block, always as a string.","array_value":""}],"syntax":"{% capture variable %}\n  value\n{% endcapture %}","syntax_keywords":[{"keyword":"variable","description":"The name of the variable being created."},{"keyword":"value","description":"The value you want to assign to the variable."}],"examples":[{"name":"","description":"","syntax":"","path":"/products/health-potion","raw_liquid":"{%- assign up_title = product.title | upcase -%}\n{%- assign down_title = product.title | downcase -%}\n{%- assign show_up_title = true -%}\n\n{%- capture title -%}\n  {% if show_up_title -%}\n    Upcase title: {{ up_title }}\n  {%- else -%}\n    Downcase title: {{ down_title }}\n  {%- endif %}\n{%- endcapture %}\n\n{{ title }}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"conditional","deprecated":false,"deprecation_reason":"","description":"","parameters":[],"summary":"Renders a specific expression depending on the value of a specific variable.","name":"case","syntax":"{% case variable %}\n  {% when first_value %}\n    first_expression\n  {% when second_value %}\n    second_expression\n  {% else %}\n    third_expression\n{% endcase %}","syntax_keywords":[{"keyword":"variable","description":"The name of the variable you want to base your case statement on."},{"keyword":"first_value","description":"A specific value to check for."},{"keyword":"second_value","description":"A specific value to check for."},{"keyword":"first_expression","description":"An expression to be rendered when the variable's value matches `first_value`."},{"keyword":"second_expression","description":"An expression to be rendered when the variable's value matches `second_value`."},{"keyword":"third_expression","description":"An expression to be rendered when the variable's value has no match."}],"examples":[{"name":"","description":"","syntax":"","path":"/products/health-potion","raw_liquid":"{% case product.type %}\n  {% when 'Health' %}\n    This is a health potion.\n  {% when 'Love' %}\n    This is a love potion.\n  {% else %}\n    This is a potion.\n{% endcase %}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"Multiple values","description":"A `when` tag can accept multiple values. When multiple values are provided, the expression is returned when the variable matches any of the values inside of the tag.\nProvide the values as a comma-separated list, or separate them using an `or` operator.\n","syntax":"{% case variable %}\n  {% when first_value or second_value or third_value %}\n    first_expression\n  {% when fourth_value, fifth_value, sixth_value %}\n    second_expression\n  {% else %}\n    third_expression\n{% endcase %}\n","path":"/products/health-potion","raw_liquid":"{% case product.tags %}\n  {% when 'Love' or 'Luck' %}\n    This is a love or luck potion.\n  {% when 'Strength','Health' %}\n    This is a strength or health potion.\n  {% else %}\n    This is a potion.\n{% endcase %}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"syntax","deprecated":false,"deprecation_reason":"","description":"Any text inside `comment` tags won't be output, and any Liquid code will be parsed, but not executed.","parameters":[],"summary":"Prevents an expression from being rendered or output.","name":"comment","syntax":"{% comment %}\n  content\n{% endcomment %}","syntax_keywords":[{"keyword":"content","description":"The content of the comment."}],"examples":[{"name":"Inline comments","description":"Inline comments prevent an expression inside of a tag `{% %}` from being rendered or output.\n\nYou can use inline comment tags to annotate your code, or to temporarily prevent logic in your code from executing.\n\nYou can create multi-line inline comments. However, each line in the tag must begin with a `#`, or a syntax error will occur.\n","syntax":"{% # content %}","path":"/","raw_liquid":"{% # this is a comment %}\n\n{% # for i in (1..3) -%}\n  {{ i }}\n{% # endfor %}\n\n{%\n  ###############################\n  # This is a comment\n  # across multiple lines\n  ###############################\n%}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"Inline comments inside `liquid` tags","description":"You can use inline comment tags inside [`liquid` tags](/docs/api/liquid/tags/liquid). The tag must be used for each line that you want to comment.\n","syntax":"","path":"/","raw_liquid":"{% liquid\n  # this is a comment\n  assign topic = 'Learning about comments!'\n  echo topic\n%}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"platformOS","deprecated":false,"deprecation_reason":"","deprecation_replacement":"","description":"Stores a block of markup in an identifier for later use.\nRender it later with `yield` tag.","syntax":"@example\n{% content_for 'block_identifier' %}\n\n{% endcontent_for %}","platformOS":true,"name":"content_for","parameters":[{"description":"the markups will be stored under this name","name":"name","required":false,"types":["string"],"array_value":""},{"description":"optional. If the flush parameter is true content_for replaces the blocks it is given instead of appending content to the\nexisting one","name":"flush","required":false,"types":["boolean"],"array_value":""}],"return_type":[],"examples":[{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% content_for 'header' %}\n  Hello world\n{% endcontent_for %}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"platformOS","deprecated":false,"deprecation_reason":"","deprecation_replacement":"","description":"Set locale in context to given language","syntax":"{% context language: 'en' %}","platformOS":true,"name":"context","parameters":[{"description":"language 2 letter","name":"language","required":false,"types":["string"],"array_value":""}],"return_type":[],"examples":[{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% context language: 'de' %}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"platformOS","deprecated":true,"deprecation_reason":"Use {% context %} instead.","deprecation_replacement":"context","description":"Alias of `context`, kept for backwards compatibility.","syntax":"","platformOS":true,"name":"context_rc","parameters":[],"return_type":[],"examples":[]},{"category":"iteration","deprecated":false,"deprecation_reason":"","description":"","parameters":[],"summary":"Causes a [`for` loop](/docs/api/liquid/tags/for) to skip to the next iteration.","name":"continue","syntax":"{% continue %}","syntax_keywords":[],"examples":[{"name":"","description":"","syntax":"","path":"/","raw_liquid":"{% for i in (1..5) -%}\n  {%- if i == 4 -%}\n    {% continue %}\n  {%- else -%}\n    {{ i }}\n  {%- endif -%}\n{%- endfor %}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"iteration","deprecated":false,"deprecation_reason":"","description":"The `cycle` tag must be used inside a `for` loop.\n\n\u003e Tip:\n\u003e Use the `cycle` tag to output text in a predictable pattern. For example, to apply odd/even classes to rows in a table.","parameters":[],"summary":"Loops through a group of strings and outputs them one at a time for each iteration of a [`for` loop](/docs/api/liquid/tags/for).","name":"cycle","syntax":"{% cycle string, string, ... %}","syntax_keywords":[],"examples":[{"name":"","description":"","syntax":"","path":"/","raw_liquid":"{% for i in (1..4) -%}\n  {% cycle 'one', 'two', 'three' %}\n{%- endfor %}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"Create unique cycle groups","description":"If you include multiple `cycle` tags with the same parameters, in the same template, then each set of tags is treated as the same group. This means that it's possible for a `cycle` tag to output any of the provided strings, instead of always starting at the first string.\nTo account for this, you can specify a group name for each `cycle` tag.\n","syntax":"{% cycle string: string, string, ... %}","path":"/","raw_liquid":"\u003c!-- Iteration 1 --\u003e\n{% for i in (1..4) -%}\n  {% cycle 'one', 'two', 'three' %}\n{%- endfor %}\n\n\u003c!-- Iteration 2 --\u003e\n{% for i in (1..4) -%}\n  {% cycle 'one', 'two', 'three' %}\n{%- endfor %}\n\n\u003c!-- Iteration 3 --\u003e\n{% for i in (1..4) -%}\n  {% cycle 'group_1': 'one', 'two', 'three' %}\n{%- endfor %}\n\n\u003c!-- Iteration 4 --\u003e\n{% for i in (1..4) -%}\n  {% cycle 'group_2': 'one', 'two', 'three' %}\n{%- endfor %}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"variable","deprecated":false,"deprecation_reason":"","description":"Variables that are declared with `decrement` are unique to the [partial](/developer-guide/platformos-workflow/directory-structure#views-pages-layouts-and-partials), [template](/themes/architecture/templates),\nor [section](/themes/architecture/sections) file that they're created in. However, the variable is shared across\n[partial](/developer-guide/platformos-workflow/codebase#views-pages-layouts-and-partials) included in the file.\n\nSimilarly, variables that are created with `decrement` are independent from those created with [`assign`](/docs/api/liquid/tags/assign)\nand [`capture`](/docs/api/liquid/tags/capture). However, `decrement` and [`increment`](/docs/api/liquid/tags/increment) share\nvariables.","parameters":[],"summary":"Creates a new variable, with a default value of -1, that's decreased by 1 with each subsequent call.","name":"decrement","return_type":[{"type":"number","name":"","description":"The counter's value, readable under the same name — unless a variable of that name was assigned, which shadows the counter.","array_value":""}],"syntax":"{% decrement variable_name %}","syntax_keywords":[{"keyword":"variable_name","description":"The name of the variable being decremented."}],"examples":[{"name":"","description":"","syntax":"","path":"/","raw_liquid":"{% decrement variable %}\n{% decrement variable %}\n{% decrement variable %}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"syntax","deprecated":false,"deprecation_reason":"","description":"Content inside a `doc` block is never rendered. It is read by platformOS Check and by editor tooling, which use the\nannotations to validate a partial's arguments, complete them at the call site, and show its documentation on hover.\n\nThe annotations a block may carry, and the types a `@param` may name, are published in\n[liquid_doc.json](/api/liquid/liquid_doc.json). See the [doc tag reference](/api-reference/liquid/doc) for the full syntax.","parameters":[],"summary":"Documents a partial's arguments, inline, for tooling to read.","name":"doc","syntax":"{% doc %}\n  @param {type} name - description\n{% enddoc %}","syntax_keywords":[{"keyword":"@param","description":"An argument the partial accepts. Square brackets around the name make it optional."},{"keyword":"@example","description":"How the partial is called. May be repeated."},{"keyword":"@description","description":"What the partial does."}],"examples":[{"name":"","description":"","syntax":"","path":"/","raw_liquid":"{% doc %}\n  @description Renders a user avatar.\n\n  @param {string} url - The avatar image URL\n  @param {number} [size] - The width in pixels\n\n  @example\n  {% render 'avatar', url: current_user.avatar_url, size: 64 %}\n{% enddoc %}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"syntax","deprecated":false,"deprecation_reason":"","description":"Using the `echo` tag is the same as wrapping an expression in curly brackets (`{{` and `}}`). However, unlike the curly\nbracket method, you can use the `echo` tag inside [`liquid` tags](/docs/api/liquid/tags/liquid).\n\n\u003e Tip:\n\u003e You can use [filters](/docs/api/liquid/filters) on expressions inside `echo` tags.","parameters":[],"summary":"Outputs an expression.","name":"echo","syntax":"{% liquid\n  echo expression\n%}","syntax_keywords":[{"keyword":"expression","description":"The expression to be output."}],"examples":[{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% echo 'Hello' | upcase %}\n\n{% liquid\n  echo 5 | plus: 2\n%}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"conditional","deprecated":false,"deprecation_reason":"","description":"You can use the `else` tag with the following tags:\n\n- [`case`](/docs/api/liquid/tags/case)\n- [`if`](/docs/api/liquid/tags/if)\n- [`unless`](/docs/api/liquid/tags/unless)","parameters":[],"summary":"Allows you to specify a default expression to execute when no other condition is met.","name":"else","syntax":"{% else %}\n  expression","syntax_keywords":[{"keyword":"expression","description":"The expression to render if no other condition is met."}],"examples":[{"name":"","description":"","syntax":"","path":"/products/health-potion","raw_liquid":"{% if product.available %}\n  This product is available!\n{% else %}\n  This product is sold out!\n{% endif %}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"iteration","deprecated":false,"deprecation_reason":"","description":"","parameters":[],"summary":"Allows you to specify a default expression to execute when a [`for` loop](/docs/api/liquid/tags/for) has zero length.","name":"else","syntax":"{% for variable in array %}\n  first_expression\n{% else %}\n  second_expression\n{% endfor %}","syntax_keywords":[{"keyword":"variable","description":"The current item in the array."},{"keyword":"array","description":"The array to iterate over."},{"keyword":"first_expression","description":"The expression to render for each iteration."},{"keyword":"second_expression","description":"The expression to render if the loop has zero length."}],"examples":[{"name":"","description":"","syntax":"","path":"/collections/empty","raw_liquid":"{% for product in collection.products %}\n  {{ product.title }}\u003cbr\u003e\n{% else %}\n  There are no products in this collection.\n{% endfor %}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"conditional","deprecated":false,"deprecation_reason":"","description":"You can use as many `elsif` tags as you need. They are evaluated in order, and the first one whose condition is met is rendered.","parameters":[],"summary":"Adds another condition to an [`if`](/docs/api/liquid/tags/if) tag.","name":"elsif","syntax":"{% elsif condition %}\n  expression","syntax_keywords":[{"keyword":"condition","description":"The condition to evaluate."},{"keyword":"expression","description":"The expression to render if the condition is met."}],"examples":[{"name":"","description":"","syntax":"","path":"/products/health-potion","raw_liquid":"{% if product.type == 'love-potion' %}\n  This is a love potion!\n{% elsif product.type == 'health-potion' %}\n  This is a health potion!\n{% else %}\n  This is a potion!\n{% endif %}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"platformOS","deprecated":true,"deprecation_reason":"Use {% graphql %} instead.","deprecation_replacement":"graphql","description":"Executes a GraphQL query stored in a file and assigns the result to a variable.\nSuperseded by the `graphql` tag, which takes its arguments as expressions rather than\nas the NAMES of variables to look up in the current scope.","syntax":"{% execute_query 'query_name', result_name: 'g', argument: variable_name %}","platformOS":true,"name":"execute_query","parameters":[{"description":"name of the GraphQL query. For get_users.graphql the name is get_users","name":"query_name","required":false,"types":["string"],"array_value":""},{"description":"optional. Variable the result is assigned to. Defaults to `g`","name":"result_name","required":false,"types":["string"],"array_value":""},{"description":"any other key:value pair names a variable in the current scope, whose value is passed to the query","name":"arguments","required":false,"types":["object"],"array_value":""}],"return_type":[{"type":"object","name":"","description":"the GraphQL response, exactly as {% graphql %} leaves it","array_value":""}],"examples":[{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% execute_query 'get_models', result_name: 'g', model_id: model_id %}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"platformOS","deprecated":false,"deprecation_reason":"","deprecation_replacement":"","description":"Makes variables defined inside partial accessible anywhere via context.exports.`namespace`","syntax":"export a, b, namespace: 'namespace'","platformOS":true,"name":"export","parameters":[{"description":"variable to be stored inside the namespace","name":"variable","required":false,"types":["object"],"array_value":""},{"description":"namespace under which variable will be in context.exports","name":"namespace","required":false,"types":["string"],"array_value":""}],"return_type":[],"examples":[{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% liquid\n  assign a = 'value for a'\n  assign b = 'value for b'\n  export a, b, namespace: 'my_hash'\n%}\n\n{{ context.exports.my_hash }} =\u003e { \"a\": \"value for a\", \"b\": \"value for b\" }\n{% assign company = {\n  \"name\": \"platformOS\",\n  \"technologies\": [\"liquid\", \"graphql\"],\n  \"countries\": { \"USA\": 5, \"Poland\": 5, \"Romania\": 2 }\n} %}\n\n{% export company, namespace: 'data' %}\n\n{{ context.exports.data }} =\u003e\n  {\"company\":{\"name\":\"platformOS\",\"technologies\":[\"liquid\",\"graphql\"],\"countries\":{\"USA\":5,\"Poland\":5,\"Romania\":2}}}\n{{ context.exports.data.company.technologies }} =\u003e [\"liquid\",\"graphql\"]\n{{ context.exports.data.company.name }} =\u003e platformOS","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"iteration","deprecated":false,"deprecation_reason":"","description":"Every `for` loop has an associated [`forloop` object](/api-reference/liquid/loops#helper-variables) with information about the loop.","parameters":[{"description":"The number of iterations to perform.","name":"limit","required":false,"types":["number"]},{"description":"The 1-based index to start iterating at.","name":"offset","required":false,"types":["number"]},{"description":"A custom numeric range to iterate over.","name":"range","required":false,"types":["untyped"]},{"description":"Iterate in reverse order.","name":"reversed","required":false,"types":["untyped"]}],"summary":"Renders an expression for every item in an array.","name":"for","syntax":"{% for variable in array %}\n  expression\n{% endfor %}","syntax_keywords":[{"keyword":"variable","description":"The current item in the array."},{"keyword":"array","description":"The array to iterate over."},{"keyword":"expression","description":"The expression to render for each iteration."}],"examples":[{"name":"","description":"","syntax":"","path":"/collections/sale-potions","raw_liquid":"{% for product in collection.products -%}\n  {{ product.title }}\n{%- endfor %}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"limit","description":"You can limit the number of iterations using the `limit` parameter.","syntax":"{% for variable in array limit: number %}\n  expression\n{% endfor %}\n","path":"/collections/sale-potions","raw_liquid":"{% for product in collection.products limit: 2 -%}\n  {{ product.title }}\n{%- endfor %}","parameter":true,"display_type":"text","show_data_tab":true},{"name":"offset","description":"You can specify a 1-based index to start iterating at using the `offset` parameter.","syntax":"{% for variable in array offset: number %}\n  expression\n{% endfor %}\n","path":"/collections/sale-potions","raw_liquid":"{% for product in collection.products offset: 2 -%}\n  {{ product.title }}\n{%- endfor %}","parameter":true,"display_type":"text","show_data_tab":true},{"name":"range","description":"Instead of iterating over specific items in an array, you can specify a numeric range to iterate over.\n\n\u003e Note:\n\u003e You can define the range using both literal and variable values.\n","syntax":"{% for variable in (number..number) %}\n  expression\n{% endfor %}\n","path":"/collections/all","raw_liquid":"{% for i in (1..3) -%}\n  {{ i }}\n{%- endfor %}\n\n{%- assign lower_limit = 2 -%}\n{%- assign upper_limit = 4 -%}\n\n{% for i in (lower_limit..upper_limit) -%}\n  {{ i }}\n{%- endfor %}","parameter":true,"display_type":"text","show_data_tab":true},{"name":"reversed","description":"You can iterate in reverse order using the `reversed` parameter.","syntax":"{% for variable in array reversed %}\n  expression\n{% endfor %}\n","path":"/collections/sale-potions","raw_liquid":"{% for product in collection.products reversed -%}\n  {{ product.title }}\n{%- endfor %}","parameter":true,"display_type":"text","show_data_tab":true}]},{"category":"platformOS","deprecated":false,"deprecation_reason":"","deprecation_replacement":"","description":"Used to generate a html form element for a resource. Use within `form configuration`.\nInside the tag you can use `form_builder` variable.","syntax":"{% form %}\n\n{% endform %}","platformOS":true,"name":"form","parameters":[{"description":"set id attribute in `\u003cform id=\"\"\u003e` element","name":"html-id","required":false,"types":["string"],"array_value":""},{"description":"add `novalidate` attribute to `\u003cform novalidate\u003e` element","name":"html-novalidate","required":false,"types":["string"],"array_value":""},{"description":"add css class `\u003cform class=\"\"\u003e` element","name":"html-class","required":false,"types":["string"],"array_value":""},{"description":"add `enctype=\"multipart/form-data\"` attribute to `\u003cform enctype=\"multipart/form-data\"\u003e` element.\nMultipart is enabled by default","name":"html-multipart","required":false,"types":["boolean"],"array_value":""},{"description":"add data attribute to `\u003cform data-[attr]=\"\"\u003e` element, one per attribute name","name":"html-data-*","required":false,"types":["string"],"array_value":""},{"description":"the resource name the form is built for; defaults to `form`","name":"as","required":false,"types":["string"],"array_value":""},{"description":"HTTP method the form submits with — get, post, put, patch or delete","name":"method","required":false,"types":["string"],"array_value":""},{"description":"target the form submits to; defaults to the form configuration's resource path","name":"url","required":false,"types":["string"],"array_value":""},{"description":"builds the form for a resource of this type instead of the configured one","name":"form_for_type","required":false,"types":["string"],"array_value":""}],"return_type":[],"examples":[{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% form %}\n  {{ form_builder }}\n{% endform %}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% form html-id: 'someid', html-novalidate: true, html-class: 'big-form green-form', html-data-user-id: '12345', html-multipart: false %}\n{% endform %}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"platformOS","deprecated":false,"deprecation_reason":"","deprecation_replacement":"","description":"Stores a variable returned by a partial. The partial must return data using the `return` tag.\nAll variables must be passed explicitly to the function - variables from upper scope are not visible.\n\nSupports bracket notation, dot notation, and mixed notation (combining brackets and dots).\n\nVariable names must start with a letter or underscore, followed by letters, numbers, underscores, or hyphens.","syntax":"{% function variable = 'path/to/partial', arg1: value %}","platformOS":true,"name":"function","parameters":[{"description":"name the partial's returned value is assigned to; accepts bracket, dot and mixed notation","name":"variable","required":false,"types":["string"],"array_value":""},{"description":"path of the partial to invoke, relative to app/views/partials","name":"partial_path","required":false,"types":["string"],"array_value":""},{"description":"any other key:value pair is passed to the partial as a variable of that name","name":"arguments","required":false,"types":["object"],"array_value":""}],"return_type":[{"type":"untyped","name":"","description":"whatever the partial hands back through its own `{% return %}`, which is the\npartial author's to decide rather than this tag's","array_value":""}],"examples":[{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% function result = 'partials/compute', foo: 'bar' %}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% assign data = {} %}\n{% assign data[\"foo\"] = {} %}\n{% function data[\"foo\"][\"bar\"] = 'partials/compute', input: 'baz' %}\n{{ data }} =\u003e {\"foo\":{\"bar\":\"result_from_partial\"}}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% assign items = [] %}\n{% function items \u003c\u003c 'partials/fetch_item', id: 1 %}\n{% function items \u003c\u003c 'partials/fetch_item', id: 2 %}\n{{ items }} =\u003e [\"item_1\",\"item_2\"]","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% assign response = {} %}\n{% assign response[\"data\"] = [] %}\n{% function response[\"data\"] \u003c\u003c 'partials/fetch_user', id: 1 %}\n{% function response[\"data\"] \u003c\u003c 'partials/fetch_user', id: 2 %}\n{% assign response[\"metadata\"] = {} %}\n{% function response[\"metadata\"][\"total\"] = 'partials/count_users' %}\n{{ response }} =\u003e {\"data\":[\"user_1\",\"user_2\"],\"metadata\":{\"total\":2}}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"# partials/greeting\n{% return 'Hello ' | append: name %}\n\n# calling code\n{% function result = 'partials/greeting', name: 'Alice' %}\n{{ result }} =\u003e Hello Alice","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% assign user = {} %}\n{% assign user.profile = {} %}\n{% function user.profile[\"name\"] = 'partials/get_name', id: 123 %}\n{% function user[\"email\"] = 'partials/get_email', id: 123 %}\n{{ user }} =\u003e {\"profile\":{\"name\":\"John\"},\"email\":\"john@example.com\"}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"platformOS","deprecated":true,"deprecation_reason":"Use {% function %} instead.","deprecation_replacement":"function","description":"Alias of `function`, kept for backwards compatibility.","syntax":"","platformOS":true,"name":"function_rc","parameters":[],"return_type":[],"examples":[]},{"category":"platformOS","deprecated":false,"deprecation_reason":"","deprecation_replacement":"","description":"Used to execute GraphQL query stored in a file or invoke GraphQL query inline. All arguments provided to the tag will be passed to GraphQL.\nIt returns a hash with the data or the errors that occurred (for example, variable type mismatch, required variable not provided,\nsyntax error) etc.","syntax":"{% graphql g = \"path/to/graphql\", arg0: value %}","platformOS":true,"name":"graphql","parameters":[{"description":"name of the GraphQL query. For get_users.graphql file name of the query is get_users","name":"query_name","required":false,"types":["string"],"array_value":""},{"description":"optional. key:value pair(s) which will be passed to GraphQL query. For example, if\nyour query looks like `query my_query($email: String!)`, then you can provide `email: \"my-email@example.com\"`","name":"arguments","required":false,"types":["object"],"array_value":""},{"description":"optional. Either a Hash or a String) of the arguments which will be passed to GraphQL query. See examples below.","name":"args","required":false,"types":["object"],"array_value":""}],"return_type":[{"type":"object","name":"","description":"the GraphQL response, keyed by the query's root fields — or by `errors` when\nthe query failed. Measured: `{% graphql g %}{ records { total_entries } }{% endgraphql %}`\nleaves a value `hash_keys` answers `[\"records\"]` for.","array_value":""}],"examples":[{"name":"","description":"","syntax":"","path":"","raw_liquid":"Invoke query \"get_models\" and store the result in variable \"g\":\n{% graphql g = \"get_models\", model_id: context.params.slug2 %}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"Chain filters to extract results in one line:\n{% graphql g = \"get_models\", model_id: context.params.slug2 | dig: 'models', 'results' %}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"Split arguments across multiple lines inside a {% liquid %} block:\n{% liquid\n  graphql g = \"get_models\",\n    model_id: context.params.slug2,\n    user_id: context.params.user_id\n%}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"Pass all arguments at once as a hash to have graphql tag in one line and/or compose arguments hash dynamically:\n{% assign arguments = {\n  \"model_id\": context.params.slug2,\n  \"user_id\": context.params.user_id\n} %}\n\n{% graphql g = \"get_models\", args: arguments %}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"Pass all arguments at once as a JSON string:\n\n{% capture arguments %}\n{\n   \"per_page\": 20,\n   \"page\": 2\n}\n{% endcapture %}\n\n{% graphql g = \"get_models\", args: arguments %}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"Invoke inline query and store the result in variable \"g\". This is recommended for one-time used queries.\n\n{% graphql g, id: context.params.slug2, message: \"new message\" %}\n  mutation set_message($id: ID!, $message: String!) {\n   model_update(\n     id: $id\n     model: {\n       properties: [{ name: \"message\", value: $message }]\n     }\n   ) {\n     id\n     message: property(name: \"message\")\n   }\n  }\n{% endgraphql %}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"platformOS","deprecated":true,"deprecation_reason":"Use {% assign %} tag instead, which now supports hash assignment syntax","deprecation_replacement":"assign","description":"DEPRECATED: This tag is deprecated. Use {% assign %} tag instead.\nThe assign tag now supports the same hash assignment syntax.\n\nPreviously allowed to easily modify a Hash with a syntax same as assign tag.","syntax":"{% hash_assign variable['key'] = value %} (DEPRECATED - use {% assign variable['key'] = value %} instead)","platformOS":true,"name":"hash_assign","parameters":[{"description":"name of the hash to modify, with the key to write in bracket or dot notation","name":"variable","required":false,"types":["string"],"array_value":""},{"description":"value to assign at that key","name":"value","required":false,"types":["object"],"array_value":""}],"return_type":[],"examples":[{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% assign my_hash = { \"a\": { \"b\": { \"c\": \"12\", \"d\": \"hello\" } } } %}\n{% hash_assign my_hash[\"a\"][\"e\"] = \"assign\" | upcase %}\n{{ my_hash }} =\u003e {\"a\":{\"b\":{\"c\":\"12\",\"d\":\"hello\"},\"e\":\"ASSIGN\"}}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% assign my_hash = { \"a\": { \"b\": { \"c\": \"12\", \"d\": \"hello\" } } } %}\n{% assign my_hash[\"a\"][\"e\"] = \"assign\" | upcase %}\n{{ my_hash }} =\u003e {\"a\":{\"b\":{\"c\":\"12\",\"d\":\"hello\"},\"e\":\"ASSIGN\"}}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"conditional","deprecated":false,"deprecation_reason":"","description":"","parameters":[],"summary":"Renders an expression if a specific condition is `true`.","name":"if","syntax":"{% if condition %}\n  expression\n{% endif %}","syntax_keywords":[{"keyword":"condition","description":"The condition to evaluate."},{"keyword":"expression","description":"The expression to render if the condition is met."}],"examples":[{"name":"","description":"","syntax":"","path":"/products/glacier-ice","raw_liquid":"{% if product.compare_at_price \u003e product.price %}\n  This product is on sale!\n{% endif %}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"elsif","description":"You can use the `elsif` tag to check for multiple conditions.","syntax":"","path":"/products/health-potion","raw_liquid":"{% if product.type == 'Love' %}\n  This is a love potion!\n{% elsif product.type == 'Health' %}\n  This is a health potion!\n{% endif %}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"iteration","deprecated":false,"deprecation_reason":"","description":"Most useful inside a [`for` loop](/docs/api/liquid/tags/for), where it suppresses output for consecutive iterations that produce the same value.","parameters":[],"summary":"Renders its contents only if the output differs from the previous iteration.","name":"ifchanged","syntax":"{% ifchanged %}\n  expression\n{% endifchanged %}","syntax_keywords":[{"keyword":"expression","description":"The expression to render when its output differs from the previous iteration."}],"examples":[{"name":"","description":"","syntax":"","path":"/collections/potions","raw_liquid":"{% for product in collection.products %}\n  {% ifchanged %}\n    {{ product.type }}\n  {% endifchanged %}\n  {{ product.title }}\n{% endfor %}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"theme","deprecated":false,"deprecation_reason":"","description":"Inside the partial, you can access and alter variables that are [created](/docs/api/liquid/tags/variable-tags) outside of the\npartial. Prefer [`render`](/docs/api/liquid/tags/render) for self-contained partials; use `include` when the partial must run in the caller's scope.","parameters":[],"summary":"Renders a [partial](/developer-guide/platformos-workflow/directory-structure#views-pages-layouts-and-partials).","name":"include","syntax":"{% include 'filename' %}","syntax_keywords":[{"keyword":"filename","description":"The name of the partial to render, without the `.liquid` extension."}],"examples":[]},{"category":"platformOS","deprecated":false,"deprecation_reason":"","deprecation_replacement":"","description":"This tag should be used to render forms defined in forms directory","syntax":"{% include_form 'path/to/form' %}","platformOS":true,"name":"include_form","parameters":[{"description":"name of the form configuration from forms directory","name":"form_name","required":false,"types":["string"],"array_value":""},{"description":"id of the resource you want to edit","name":"id","required":false,"types":["number"],"array_value":""},{"description":"name of the resource type, f.e. name of custom_model_type, transactable_type, user_profile_type","name":"parent_resource_id","required":false,"types":["string"],"array_value":""}],"return_type":[],"examples":[{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% include_form 'signup_form' %}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% include_form 'edit_user', id: user.id %}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% include_form 'manager_invite_to_interview', parent_resource_id: 'invitation', user: g.user %}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"variable","deprecated":false,"deprecation_reason":"","description":"Variables that are declared with `increment` are unique to the [partial](/developer-guide/platformos-workflow/directory-structure#views-pages-layouts-and-partials), [template](/themes/architecture/templates),\nor [section](/themes/architecture/sections) file that they're created in. However, the variable is shared across\n[partial](/developer-guide/platformos-workflow/codebase#views-pages-layouts-and-partials) included in the file.\n\nSimilarly, variables that are created with `increment` are independent from those created with [`assign`](/docs/api/liquid/tags/assign)\nand [`capture`](/docs/api/liquid/tags/capture). However, `increment` and [`decrement`](/docs/api/liquid/tags/decrement) share\nvariables.","parameters":[],"summary":"Creates a new variable, with a default value of 0, that's increased by 1 with each subsequent call.","name":"increment","return_type":[{"type":"number","name":"","description":"The counter's value, readable under the same name — unless a variable of that name was assigned, which shadows the counter.","array_value":""}],"syntax":"{% increment variable_name %}","syntax_keywords":[{"keyword":"variable_name","description":"The name of the variable being incremented."}],"examples":[{"name":"","description":"","syntax":"","path":"/","raw_liquid":"{% increment variable %}\n{% increment variable %}\n{% increment variable %}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"syntax","deprecated":false,"deprecation_reason":"","description":"Because the tags don't have delimeters, each tag needs to be on its own line.\n\n\u003e Tip:\n\u003e Use the [`echo` tag](/docs/api/liquid/tags/echo) to output an expression inside `liquid` tags.","parameters":[],"summary":"Allows you to have a block of Liquid without delimeters on each tag.","name":"liquid","syntax":"{% liquid\n  expression\n%}","syntax_keywords":[{"keyword":"expression","description":"The expression to be rendered inside the `liquid` tag."}],"examples":[{"name":"","description":"","syntax":"","path":"/products/health-potion","raw_liquid":"{% liquid\n  # Show a message that's customized to the product type\n\n  assign product_type = product.type | downcase\n  assign message = ''\n\n  case product_type\n    when 'health'\n      assign message = 'This is a health potion!'\n    when 'love'\n      assign message = 'This is a love potion!'\n    else\n      assign message = 'This is a potion!'\n  endcase\n\n  echo message\n%}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"platformOS","deprecated":false,"deprecation_reason":"","deprecation_replacement":"","description":"Print information to environment logs. To view logs run `pos-cli gui serve \u003cenvironment\u003e` in your application directory and go to `http://localhost:3333/Logs`. If you prefer seeing logs in the terminal, run `pos-cli gui logs \u003cenvironment\u003e`","syntax":"{% log variable, type: 'type' %}","platformOS":true,"name":"log","parameters":[{"description":"Any object that can be printed","name":"message","required":false,"types":["object"],"array_value":""},{"description":"type of log entry. Use it to tag your logs to make it easier to differentiate logs. If you set it to 'error' pos-cli will\nalso notify your OS about it if your OS supports it.","name":"type","required":false,"types":["string"],"array_value":""},{"description":"environment where the entry should be created; can be any of 'all', 'staging', 'production'. Default: 'all'","name":"env","required":false,"types":["string"],"array_value":""}],"return_type":[],"examples":[{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% log 'hello world' %}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% log params, type: 'request-params' %}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% log user.id, type: 'debug' %}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% log context.current_user, type: 'error' %}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% log context.current_user, type: 'error', env: 'staging' %}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"platformOS","deprecated":true,"deprecation_reason":"Use {% assign %} tag instead, which now supports JSON literals","deprecation_replacement":"assign","description":"DEPRECATED: This tag is deprecated. Use {% assign %} tag instead, which now accepts a\nJSON literal directly and produces the same Hash.\n\nNote this is a REWRITE and not a rename: the body moves into the markup, and values\ninterpolated with the `json` filter become plain expressions.\n\nPreviously captured and parsed the JSON string inside of the opening and closing tags\nand assigned it to a variable.","syntax":"{% parse_json variable %}\n\n{% endparse_json %} (DEPRECATED - use {% assign variable = { ... } %} instead)","platformOS":true,"name":"parse_json","parameters":[{"description":"variable name that will be used to assign contents after it is parsed","name":"variable_name","required":false,"types":["string"],"array_value":""},{"description":"valid JSON string to be assigned","name":"content","required":false,"types":["string"],"array_value":""}],"return_type":[{"type":"untyped","name":"","description":"the parsed document, whose type is the BODY's — measured, `{\"a\":1}` leaves a\nHash and `[1,2]` leaves an Array, so no single type describes it","array_value":""}],"examples":[{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% parse_json car %}{ \"type\": \"SUV\", \"gearbox\": \"AT\" }{% endparse_json %}\n{% assign car = { \"type\": \"SUV\", \"gearbox\": \"AT\" } %}\nBoth produce {\"type\" =\u003e \"SUV\", \"gearbox\" =\u003e \"AT\"}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% assign color = \"red\" %}\n{% parse_json data %}{ \"color\": {{ color | json }} }{% endparse_json %}\n{% assign data = { \"color\": color } %}\nBoth produce {\"color\" =\u003e \"red\"}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% parse_json car %}\n  { \"type\": \"SUV\", \"gearbox\": \"AT\" }\n{% endparse_json %}\n\n{{ car }} =\u003e {\"type\" =\u003e \"SUV\", \"gearbox\" =\u003e \"AT\"}\n{{ car.type }} =\u003e SUV","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% parse_json cars %}\n  [\n    { \"maker\": \"Honda\", \"model\": \"CRX\" },\n    { \"maker\": \"Subaru\", \"model\": \"Forester\"},\n    { \"maker\": \"Lexus\", \"model\": \"LFA\" }\n  ]\n{% endparse_json %}\n\n{{ cars }} =\u003e {\"maker\" =\u003e \"Honda\", \"model\" =\u003e \"CRX\"}{\"maker\" =\u003e \"Subaru\", \"model\" =\u003e \"Forester\"}{\"maker\" =\u003e \"Lexus\", \"model\" =\u003e \"LFA\"}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"In order to create JSON object from exsting values print them using `json` filter.\nThis is required only for strings and will escape properly `\"` and `'` characters.\nOther types will be handled automatically.\n\n{% parse_json nested %}\n  {\n    \"price\": 100\n  }\n{% endparse_json %}\n{% assign color = \"red\" %}\n{% assign car = 'Mazda \"5\"' %}\n{% parse_json data %}\n  {\n    \"color\": {{ color | json }},\n    \"car\": {{ car | json }},\n    \"nested\": {{ nested }}\n  }\n{% endparse_json %}\n\n{{ data }} =\u003e {\"color\":\"red\",\"car\":\"Mazda \\\"5\\\"\",\"nested\":{\"price\":100}}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"platformOS","deprecated":false,"deprecation_reason":"","deprecation_replacement":"","description":"Print variable, skipping any additional sanitization. It provides a way to display a variable which consists of both safe and unsafe html.\nWarning: Do not use it with data entered by users as it is gonna cause XSS.","syntax":"{% print variable %}","platformOS":true,"name":"print","parameters":[{"description":"Variable containing safe and potentially unsafe HTML","name":"variable","required":false,"types":["string"],"array_value":""}],"return_type":[],"examples":[{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% liquid\n  assign invokable_script = \"\u003cscript\u003ealert('I will be executed')\u003c/script\u003e\"\n  assign malicious_script = \"\u003cscript\u003ealert('I should be escaped')\u003c/script\u003e\"\n%}\n{% capture result %}\n  {{ malicious_script }}{{ invokable_script | html_safe }}\n{% endcapture %}\n{% print result %}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"platformOS","deprecated":true,"deprecation_reason":"Use {% graphql %} instead.","deprecation_replacement":"graphql","description":"Executes a GraphQL query stored in a file and assigns the result to a variable.\nBehaves as `execute_query` and differs only in how it reports a failed query.\nSuperseded by the `graphql` tag.","syntax":"{% query_graph 'query_name', result_name: 'g', argument: variable_name %}","platformOS":true,"name":"query_graph","parameters":[{"description":"name of the GraphQL query. For get_users.graphql the name is get_users","name":"query_name","required":false,"types":["string"],"array_value":""},{"description":"optional. Variable the result is assigned to. Defaults to `g`","name":"result_name","required":false,"types":["string"],"array_value":""},{"description":"any other key:value pair names a variable in the current scope, whose value is passed to the query","name":"arguments","required":false,"types":["object"],"array_value":""}],"return_type":[{"type":"object","name":"","description":"the GraphQL response, exactly as {% graphql %} leaves it","array_value":""}],"examples":[{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% query_graph 'get_models', result_name: 'g', model_id: model_id %}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"syntax","deprecated":false,"deprecation_reason":"","description":"","parameters":[],"summary":"Outputs any Liquid code as text instead of rendering it.","name":"raw","syntax":"{% raw %}\n  expression\n{ % endraw %}","syntax_keywords":[{"keyword":"expression","description":"The expression to be output without being rendered."}],"examples":[{"name":"","description":"","syntax":"","path":"/","raw_liquid":"{% raw %}\n{{ 2 | plus: 2 }} equals 4.\n{ % endraw %}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"platformOS","deprecated":false,"deprecation_reason":"","deprecation_replacement":"","description":"Redirects browser to target","syntax":"{% redirect_to '/path', status: 302 %}","platformOS":true,"name":"redirect_to","parameters":[{"description":"path or url","name":"target","required":false,"types":["string"],"array_value":""},{"description":"3xx HTTP code, default 302","name":"status","required":false,"types":["number"],"array_value":""}],"return_type":[],"examples":[{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% redirect_to '/dashboard' %}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% redirect_to 'https://example.com/signup' %}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% redirect_to '/dashboard', status: 301 %}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"theme","deprecated":false,"deprecation_reason":"","description":"Inside partial, you can't directly access variables that are [created](/docs/api/liquid/tags/variable-tags) outside\nof the partial. However, you can specify variables as parameters\nto pass outside variables to partials.\n\nWhile you can't directly access created variables, you can access global objects like `context`.\n\nOutside a partial, you can't access variables created inside it.\n\n\u003e Note:\n\u003e When you render a partial using the `render` tag, you can't use the [`include` tag](/docs/api/liquid/tags/include)\n\u003e inside the partial.","parameters":[],"summary":"Renders a [partial](/developer-guide/platformos-workflow/directory-structure#views-pages-layouts-and-partials).","name":"render","syntax":"{% render 'filename' %}","syntax_keywords":[{"keyword":"filename","description":"The name of the partial to render, without the `.liquid` extension and `views/partials` or `lib` prefix."}],"examples":[{"name":"for","description":"You can render a partial for every item in an array using the `for` parameter. You can also supply an optional `as` parameter to be able to reference the current item in the iteration inside the partial.\nAdditionally, you can access a [`forloop` object](/docs/api/liquid/objects/forloop) for the loop inside the partial.\n","syntax":"{% render 'filename' for array as item %}","path":"/","raw_liquid":"{% render 'filename' for array as item %}","parameter":true,"display_type":"text","show_data_tab":true},{"name":"Passing variables to a partial","description":"Variables that have been [created](/docs/api/liquid/tags/variable-tags) outside of a partial can be passed to a partial as parameters on the `render` tag.\n\n\u003e Note:\n\u003e Any changes that are made to a passed variable apply only within the partial, unless it is an array or hash.\n","syntax":"{% render 'filename', variable: value %}","path":"/","raw_liquid":"{% render 'filename', variable: value %}","parameter":true,"display_type":"text","show_data_tab":true},{"name":"with","description":"You can pass a single object to a partial using the `with` parameter. You can also supply an optional `as` parameter to specify a custom name to reference the object inside the partial.\n","syntax":"{% render 'filename' with object as name %}","path":"/","raw_liquid":"{% render 'filename' with object as name %}","parameter":true,"display_type":"text","show_data_tab":true}]},{"category":"platformOS","deprecated":true,"deprecation_reason":"Use {% include_form %} instead.","deprecation_replacement":"include_form","description":"Alias of `include_form`, kept for backwards compatibility.","syntax":"","platformOS":true,"name":"render_form","parameters":[],"return_type":[],"examples":[]},{"category":"platformOS","deprecated":false,"deprecation_reason":"","deprecation_replacement":"","description":"Allows you to set additional HTTP headers for the response.","syntax":"{% response_headers '{\"key\": \"value\"}' %}","platformOS":true,"name":"response_headers","parameters":[{"description":"headers as JSON string, default {}","name":"headers","required":false,"types":["string"],"array_value":""}],"return_type":[],"examples":[{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% response_headers '{\"foo\": \"bar\"}' %}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% response_headers '{\"Content-Type\": \"application/json\", \"X-Frame-Options\": \"somevalue\" }' %}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"platformOS","deprecated":false,"deprecation_reason":"","deprecation_replacement":"","description":"Allows you to set HTTP status for the response. Default 200.","syntax":"{% response_status 200 %}","platformOS":true,"name":"response_status","parameters":[{"description":"HTTP status, default 200","name":"status","required":false,"types":["number"],"array_value":""}],"return_type":[],"examples":[{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% response_status 204 %}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% response_status 404 %}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"platformOS","deprecated":false,"deprecation_reason":"","deprecation_replacement":"","description":"Used inside a partial invoked by a function tag to return a variable","syntax":"return variable","platformOS":true,"name":"return","parameters":[{"description":"value the partial returns to the function tag that invoked it","name":"variable","required":false,"types":["object"],"array_value":""}],"return_type":[],"examples":[{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% liquid\n  assign result = 1 | plus: 3\n  return result\n%}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"platformOS","deprecated":true,"deprecation_reason":"Use {% return %} instead.","deprecation_replacement":"return","description":"Alias of `return`, kept for backwards compatibility.","syntax":"","platformOS":true,"name":"return_rc","parameters":[],"return_type":[],"examples":[]},{"category":"platformOS","deprecated":false,"deprecation_reason":"","deprecation_replacement":"","description":"Used inside a transaction to manually rollback the transaction","syntax":"rollback","platformOS":true,"name":"rollback","parameters":[],"return_type":[],"examples":[{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% liquid\n  transaction\n    function order = 'commands/order/create', total: 100\n    unless order.valid\n      rollback\n    endunless\n  endtransaction\n%}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"platformOS","deprecated":false,"deprecation_reason":"","deprecation_replacement":"","description":"Stores data during user's session\nSets field of given name to given value in context.session","syntax":"{% session variable = \"value\" %}","platformOS":true,"name":"session","parameters":[{"description":"name of the session field to write, readable afterwards as context.session.\u003cname\u003e","name":"variable","required":false,"types":["string"],"array_value":""},{"description":"value to store; a blank or null value deletes the field instead","name":"value","required":false,"types":["object"],"array_value":""}],"return_type":[],"examples":[{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% session foo = 'bar' %}\n{{ context.session | json }} =\u003e { \"foo\": \"bar\" }","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% assign bar = \"42\" %}\n{% session foo = bar %}\n{{ context.session | json }} =\u003e { \"foo\": \"42\" }","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% session foo = null %}\n{{ context.session | json }} =\u003e {}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% session foo = blank %}\n{{ context.session | json }} =\u003e {}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"platformOS","deprecated":false,"deprecation_reason":"","deprecation_replacement":"","description":"Sign in user","syntax":"{% sign_in user_id: user_id %}","platformOS":true,"name":"sign_in","parameters":[{"description":"id of the user you want to sign in","name":"user_id","required":false,"types":["string"],"array_value":""},{"description":"number of minutes after user will be log out","name":"timeout_in_minutes","required":false,"types":["number"],"array_value":""}],"return_type":[],"examples":[{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% sign_in user_id: '12345' %}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% sign_in user_id: '12345', timeout_in_minutes: 15 %}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"platformOS","deprecated":true,"deprecation_reason":"Use {% sign_in %} instead.","deprecation_replacement":"sign_in","description":"Alias of `sign_in`, kept for backwards compatibility.","syntax":"","platformOS":true,"name":"sign_in_rc","parameters":[],"return_type":[],"examples":[]},{"category":"platformOS","deprecated":false,"deprecation_reason":"","deprecation_replacement":"","description":"Generates html for spam protection. Supports Google reCAPTCHA strategies: recaptcha_v2, recaptcha_v3 and hcaptcha","syntax":"{% spam_protection \"recaptcha_v2\" %}","platformOS":true,"name":"spam_protection","parameters":[{"description":"name of protection strategy. Default is recaptcha_v2","name":"strategy","required":false,"types":["string"],"array_value":""},{"description":"action name for reCAPTCHA V3, action may only contain alphanumeric characters and slashes","name":"action","required":false,"types":["string"],"array_value":""}],"return_type":[],"examples":[{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% form %}\n  {% spam_protection \"recaptcha_v2\" %}\n{% endform %}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% form %}\n  {% spam_protection \"recaptcha_v3\", action: \"signup\" %}\n{% endform %}","parameter":false,"display_type":"text","show_data_tab":true},{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% form %}\n  {% spam_protection \"hcaptcha\" %}\n{% endform %}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"iteration","deprecated":false,"deprecation_reason":"","description":"The `tablerow` tag must be wrapped in HTML `\u003ctable\u003e` and `\u003c/table\u003e` tags.\n\n\u003e Tip:\n\u003e Every `tablerow` loop has an associated [`tablerowloop` object](/docs/api/liquid/objects/tablerowloop) with information about the loop.","parameters":[{"description":"The number of columns that the table should have.","name":"cols","required":false,"types":["number"]},{"description":"The number of iterations to perform.","name":"limit","required":false,"types":["number"]},{"description":"The 1-based index to start iterating at.","name":"offset","required":false,"types":["number"]},{"description":"A custom numeric range to iterate over.","name":"range","required":false,"types":["untyped"]}],"summary":"Generates HTML table rows for every item in an array.","name":"tablerow","syntax":"{% tablerow variable in array %}\n  expression\n{% endtablerow %}","syntax_keywords":[{"keyword":"variable","description":"The current item in the array."},{"keyword":"array","description":"The array to iterate over."},{"keyword":"expression","description":"The expression to render."}],"examples":[{"name":"","description":"","syntax":"","path":"/collections/sale-potions","raw_liquid":"\u003ctable\u003e\n  {% tablerow product in collection.products %}\n    {{ product.title }}\n  {% endtablerow %}\n\u003c/table\u003e","parameter":false,"display_type":"text","show_data_tab":true},{"name":"cols","description":"You can define how many columns the table should have using the `cols` parameter.","syntax":"{% tablerow variable in array cols: number %}\n  expression\n{% endtablerow %}\n","path":"/collections/sale-potions","raw_liquid":"\u003ctable\u003e\n  {% tablerow product in collection.products cols: 2 %}\n    {{ product.title }}\n  {% endtablerow %}\n\u003c/table\u003e","parameter":true,"display_type":"text","show_data_tab":true},{"name":"limit","description":"You can limit the number of iterations using the `limit` parameter.","syntax":"{% tablerow variable in array limit: number %}\n  expression\n{% endtablerow %}\n","path":"/collections/sale-potions","raw_liquid":"\u003ctable\u003e\n  {% tablerow product in collection.products limit: 2 %}\n    {{ product.title }}\n  {% endtablerow %}\n\u003c/table\u003e","parameter":true,"display_type":"text","show_data_tab":true},{"name":"offset","description":"You can specify a 1-based index to start iterating at using the `offset` parameter.","syntax":"{% tablerow variable in array offset: number %}\n  expression\n{% endtablerow %}\n","path":"/collections/sale-potions","raw_liquid":"\u003ctable\u003e\n  {% tablerow product in collection.products offset: 2 %}\n    {{ product.title }}\n  {% endtablerow %}\n\u003c/table\u003e","parameter":true,"display_type":"text","show_data_tab":true},{"name":"range","description":"Instead of iterating over specific items in an array, you can specify a numeric range to iterate over.\n\n\u003e Note:\n\u003e You can define the range using both literal and variable values.\n","syntax":"{% tablerow variable in (number..number) %}\n  expression\n{% endtablerow %}\n","path":"/","raw_liquid":"\u003ctable\u003e\n  {% tablerow i in (1..3) %}\n    {{ i }}\n  {% endtablerow %}\n\u003c/table\u003e\n\n{%- assign lower_limit = 2 -%}\n{%- assign upper_limit = 4 -%}\n\n\u003ctable\u003e\n  {% tablerow i in (lower_limit..upper_limit) %}\n    {{ i }}\n  {% endtablerow %}\n\u003c/table\u003e","parameter":true,"display_type":"text","show_data_tab":true}]},{"category":"platformOS","deprecated":false,"deprecation_reason":"","deprecation_replacement":"","description":"Allows to specify search paths for theme partials via app/config.yml property \"theme_render_paths\"\n\nAssuming app/config.yml looks like this:\n\ntheme_search_paths :\n- theme/{{ context.constants.MY_THEME | default: \"custom\" }}\n- theme/simple","syntax":"{% theme_render_rc 'path/to/partial' %}","platformOS":true,"name":"theme_render_rc","parameters":[{"description":"path of the partial to render, resolved against the configured theme search paths","name":"partial_path","required":false,"types":["string"],"array_value":""},{"description":"value bound inside the partial to a variable named after the partial, or after `as`","name":"with","required":false,"types":["object"],"array_value":""},{"description":"the same as `with`, and iterated when the value is an array","name":"for","required":false,"types":["object"],"array_value":""},{"description":"name the `with` or `for` value is bound to instead of the partial's own name","name":"as","required":false,"types":["string"],"array_value":""},{"description":"any other key:value pair is passed to the partial as a variable of that name","name":"arguments","required":false,"types":["object"],"array_value":""}],"return_type":[],"examples":[{"name":"","description":"","syntax":"","path":"","raw_liquid":"\nWhen you render a partial using theme_render\n\n{% theme_render_rc 'product' %}\n\nThe system will try to render theme/custom/product, and if it does not exist, it will fallback to theme/simple/product (if it also does not exist, the missing partial error is raised)","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"platformOS","deprecated":false,"deprecation_reason":"","deprecation_replacement":"","description":"Wraps code in a database transaction block.\nAll database operations inside the block will be executed in a single transaction.\nIf any operation fails, all changes will be rolled back.\nIf a background job is scheduled within a transaction, it will only be added to the queue\nafter successfully committing the transaction.\nTransaction does NOT have its own scope for variables - any variable defined outside of the\ntransaction block will be available within the transaction block, and any variable defined\ninside the transaction block will be available outside of the transaction block.\nYou can manually force the rollback of the transaction through the `rollback` command.","syntax":"transaction timeout: 5","platformOS":true,"name":"transaction","parameters":[{"description":"timeout in seconds for the transaction block. If the transaction takes longer than this time, it will be aborted and\neverything will be rollbacked.","name":"timeout","required":false,"types":["number"],"array_value":""},{"description":"if true, forces PostgreSQL to use a custom plan for all queries inside the transaction block. Do not use this\noption unless you know what you are doing. Most likely this flag will be deleted in the future.","name":"force_custom_plan","required":false,"types":["boolean"],"array_value":""}],"return_type":[],"examples":[{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% liquid\n  transaction timeout: 5\n    function user = 'commands/user/create', email: 'test@example.com'\n    background _ = 'commands/user/send_welcome_email', user: user\n    function profile = 'commands/profile/create', user_id: user.id\n    unless profile.valid\n      rollback\n    endunless\n  endtransaction\n%}\n{% comment %}\n  This code guarantees that if profile.valid evaluates to true, both user and profile will\n  be persisted in the DB and the welcome email will be sent. If profile.valid evaluates to\n  false, or an error is raised at any point, neither user nor profile will be persisted and\n  the email will not be sent.\n{% endcomment %}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"platformOS","deprecated":false,"deprecation_reason":"","deprecation_replacement":"","description":"Allows to catch errors, especially useful with `liquid_raise_mode: true` setting in app/config.yml.","syntax":"try\n\ncatch err\n\nendtry","platformOS":true,"name":"try","parameters":[],"return_type":[],"examples":[{"name":"","description":"","syntax":"","path":"","raw_liquid":"{% liquid\n  try\n    include template_path\n  catch err\n    unless err.message contains \"can't find partial\"\n      log err, type: 'error when including template file'\n    endunless\n    include fallback_template_path\n  endtry\n%}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"platformOS","deprecated":true,"deprecation_reason":"Use {% try %} instead.","deprecation_replacement":"try","description":"Alias of `try`, kept for backwards compatibility.","syntax":"","platformOS":true,"name":"try_rc","parameters":[],"return_type":[],"examples":[]},{"category":"conditional","deprecated":false,"deprecation_reason":"","description":"\u003e Tip:\n\u003e Similar to the [`if` tag](/docs/api/liquid/tags/if), you can use `elsif` to add more conditions to an `unless` tag.","parameters":[],"summary":"Renders an expression unless a specific condition is `true`.","name":"unless","syntax":"{% unless condition %}\n  expression\n{% endunless %}","syntax_keywords":[{"keyword":"condition","description":"The condition to evaluate."},{"keyword":"expression","description":"The expression to render unless the condition is met."}],"examples":[{"name":"","description":"","syntax":"","path":"/products/health-potion","raw_liquid":"{% unless product.has_only_default_variant %}\n  // Variant selection functionality\n{% endunless %}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"conditional","deprecated":false,"deprecation_reason":"","description":"You can use the `or` operator or a comma to test a single `when` tag against multiple values.","parameters":[],"summary":"Specifies one of the values to compare against in a [`case`](/docs/api/liquid/tags/case) tag.","name":"when","syntax":"{% when value %}\n  expression","syntax_keywords":[{"keyword":"value","description":"The value to compare the case variable against."},{"keyword":"expression","description":"The expression to render if the value matches."}],"examples":[{"name":"","description":"","syntax":"","path":"/products/health-potion","raw_liquid":"{% case product.type %}\n  {% when 'love-potion' %}\n    This is a love potion!\n  {% when 'health-potion', 'mana-potion' %}\n    This is a health or mana potion!\n  {% else %}\n    This is a potion!\n{% endcase %}","parameter":false,"display_type":"text","show_data_tab":true}]},{"category":"platformOS","deprecated":false,"deprecation_reason":"","deprecation_replacement":"","description":"Execute code wrapped inside content_for","syntax":"{% yield \"value\" %}","platformOS":true,"name":"yield","parameters":[{"description":"name of content_for block","name":"name","required":false,"types":["string"],"array_value":""},{"description":"rendered instead when the named content_for block is blank or was never set","name":"default","required":false,"types":["object"],"array_value":""}],"return_type":[],"examples":[{"name":"","description":"","syntax":"","path":"","raw_liquid":"Use this in a liquid view first. Then you can use yield inside the layout (for example) or another subsequently rendered view, like below:\n{% content_for 'greeting' %}Hello world{% endcontent_for %}\n\n# another_file.liquid\n{% yield 'greeting' %}","parameter":false,"display_type":"text","show_data_tab":true}]}]


