+813-444-3589+44 118 328 3220+49-231-976765-0 | Contact us

Themes

Comment

This structure contains a review or article comment. It is specified in the Blog and Product objects and access through them. A product can have top level reviews and secondary comments to each review. Only top level reviews have a rating and a title. Blog articles also have two possible levels, but they will never contain a rating or a title, these fields are invalid when used within blogs. The following fields are available:

Variable name Object Description Note
author string The author of these texts as pseudonym. Only registered users will be able to choose a pseudonym, anonymous users will have a "Anonymous" in this field.  
content string The actual text of the review or comment.  
created_at DateTime The date when this review/comment was created or edited. EF
id int This is an unique internal numerical identifier for the given review/comment.  
is_anonymous bool If this review/comment was posted anonymously, this flag will be true. EF
is_author bool A flag that tells whether this review/comment belongs to the currently logged in user. This flag will always be false for an anonymous comment. EF
is_verified_purchase bool If the author of the review/comment has purchased this product, this flag will be true. EF
next Comment The next review/comment of this product/blog article in chronological order. EF
previous Comment The previous review/comment of this product/blog article in chronological order. EF
rating int For first-level reviews this field will contain a rating value between 1 and 5. EF
status string Depending on the status of the review/comment, this field will contain the following possible values:
  • published (published and visible)
  • removed (removed after publishing for whatever reason)
  • rejected (not approved in a moderated blog/review setting)
  • spam (marked to be spam)
  • unapproved (waiting for approval)
Basically only reviews/comments will be shown that are of status "published". There is an exception for the reviews/comments of the currently logged in user, which will be presented his reviews/comments in order to be able to e.g. edit them in order to make it approvable after being rejected.
 
sub_comments List<Comment> Returns a list of all sub comments of the current review/comment in chronological order. EF
sub_comment_allowed bool This flag tells whether sub comments (in a secondary level) are permitted. EF
title string Only valid for top level reviews: the title of the review. EF
url string Contains the URL to the page of the review/comment. This URL does not link to a valid target, so do not use this URL for now.  

Note: Some properties are exclusive to FlickRocket. If you are using a theme orginating from Shopify and want to use the extended functionality, you need to adapt your theme.

Other Filters

Filter that cannot be assigned to any of the other groups are listed here.

default

This filter checks whether the input is valid/exists, if not the parameter of the default filter is returned.

Example:


{{ '' | default: 'hello' }}  
{{ 'home' | default: 'hello' }}
{{ product.composer | default: 'There is no known composer' }}
		

Output:


hello
home
There is no known composer
		

 

hash_code & sha1

The hash_code filter will create a SHA1 hash of the given string.

Example:


{{ 'this is a test' | hash_code }}
		

Output:


FA26BE19DE6BFF93F70BC2308434E4A440BBAD02
		

Note: This filter is exclusive to FlickRocket. If you are using a theme orginating from Shopify and want to use this filter, you need to add this.

 

md5

Similar to the hash_code filter, but this one will produce a MD5 hash.

Example:


{{ 'this is a test' | md5 }}
		

Output:


54B0C58C7CE9F2A8B551351102EE0938
		

 

default_errors

This filter is used in conjunction with form errors. If something went wrong on sending a specific form (e.g. login form), then the variable form contains information about the problem in the errors field (of type Errors). In order to produce a meaningful and localized error message, this filter can be used for creating an clear text error message.

Example:


{{ form.errors | default_errors }}

Output:


<div class="errors"><ul><li> The email address is unknown.</li></ul></div>
		

 

weight_with_unit

In order to provide a localized weight for some given products (or other information like shipping cost groups), you could use the weight_with_unit filter to produce a simple formatted weight output. All weights are internally calculated in grams, but converted to lb where necessary.

Example:


{{ 1533 | weight_with_unit }}
		

Output:


3.38 lbs   (when the customer is in USA)
1,53 kg   (when the customer is in Germany)
		

Money Filters

In order to format money with the given currency, you should use one of the money filter. All of the int values for a price are times 100, the filter will set a decimal point at the right position and add a currency symbol at the correct position.

money

This filter will output a given price value (which is times 100) with the according currency symbol. All prices (and thus currency) depends on the country of the shop user.

Example:


{{ 399 | money }}
		

Output:


$3.99     (When the users origin is in the USA)
3,99 €    (When the users origin is in Germany)
		

 

money_with_currency

Same as the money filter.

 

money_without_currency

Similar to the money filter, but just outputs the price as a number with two decimal places (without any currency symbol).

Example:


{{ 399 | money_without_currency }}
		

Output:


3.99
		

String Filters

String filter are the most used filter in Liquid and usually transforms one string into another string. The following filter are supported:

append

This filter appends the parameter string to the input string.

Example:


{{ 'Hello' | append: ' world!' }}
{% assign title = product.title | append: ' (' | append: product.title.size | append: ')' %}
{{ title }}
		

Output:


Hello world!
Big Buck Bunny (14)
		

 

camelize & camelcase

This filter will convert the text into camel-look-alike (each start character is upper case and connected directly to the last word).

Example:


{{ 'Hello world, here I come!' | camelize }}
		

Output:


HelloWorldHereICome
		

 

capitalize

Converts the text into a string with the first character of each word made uppercase.

Example:


{{ 'Hello world, here I come!' | capitalize }}
		

Output:


Hello World, Here I Come!
		

 

downcase

This filter will convert all letters to lowercase.

Example:


{{ 'HellO wORld, Here I cOMe!' | downcase }}
		

Output:


hello world, here i come!
		

 

first

Returns the first character of the input string.

Example:


{{ 'Hello world, here I come!' | first }}
		

Output:


H
		

 

last

Returns the last character of the input string.

Example:


{{ 'Hello world, here I come!' | last }}
		

Output:


!
		

 

lstrip

This filter removes all whitespaces on the left side of a string (in comparison to the strip and rstrip filter).

Example:


-{{ '     A lot of whitespace left and right     ' | lstrip }}-
		

Output:


-A lot of whitespace left and right  
		

   -

pluralize

Depending on the int input value, either the first (input equals 1) or second parameter (input doesn’t equal 1) is chosen.

Example:


{{ 1 | pluralize: 'Item', 'Items' }}
{{ 2 | pluralize: 'Item', 'Items' }}
		

Output:


Item
Items
		

 

prepend

Similar to append, this filter prepends the parameter to the input string.

Example:


{{ ' world!' | prepend: 'Hello' }}
		

Output:


Hello world!
		

 

replace

The replace filter replaces all occurrences of the first parameter string within the input string by the second parameter (or just removes it if there is no second parameter).

Example:


{{ 'Welcome home - only home is home' | replace: 'home' }}
{{ 'Welcome home - only home is home' | replace: 'home', 'to the Pleasuredome' }}
		

Output:


Welcome  - only  is
Welcome to the Pleasuredome - only to the Pleasuredome is to the Pleasuredome
		

 

replace_first

Similar to the replace filter, but only replaces the first occurrence of the first parameter string within the input string (either by the second parameter, or removes the occurrence if there is no second parameter).

Example:


{{ 'Welcome home - only home is home' | replace_first: 'home' }}
{{ 'Welcome home - only home is home' | replace_first: 'home', 'to the Pleasuredome' }}
		

Output:


Welcome  - only home is home
Welcome to the Pleasuredome - only home is home
		

 

remove

The remove filter removes all occurrences of the parameter string within the input string.

Example:


{{ 'Welcome home - only home is home' | remove: 'home' }}
		

Output:


Welcome  - only  is
		

 

remove_first

Similar to the remove filter, but only removes the first occurrence of the parameter string within the input string.

Example:


{{ 'Welcome home - only home is home' | remove_first: 'home' }}
		

Output:


Welcome  - only home is home
		

 

rstrip

This filter removes all whitespaces on the right side of a string (in comparison to the strip and lstrip filter).

Example:


-{{ '     A lot of whitespace left and right     ' | rstrip }}-
		

Output:

-     A lot of whitespace left and right-

 

size

Returns the length of the input string (including all whitespaces).

Example:


{{ 'How about' | size }}
		

Output:


9
		

 

Slice

Returns the substring starting from a given position. If a second parameter is specified the substring will be of that length. If the position is negative, the position is counted from the end of the string.

Example:


{{ 'hello' | slice: 3 }}
{{ 'hello' | slice: -4, 2 }}
		

Output:


lo
el
		

 

strip

This filter removes all whitespaces on both sides of a string (in comparison to the lstrip and rstrip filter).

Example:


-{{ '     A lot of whitespace left and right     ' | strip }}-
		

Output:


-A lot of whitespace left and right-
		

 

strip_html

Removes any HTML tags from the input string.

Example:


{{ '<a href="/"><i>Welcome home</i></a>' | strip_html }}
		

Output:


Welcome home
		

 

times

This filter repeats the input string a given number of times.

Example:


{{ 'Hello ' | times: 5 }}
		

Output:


Hello Hello Hello Hello Hello
		

 

truncate

Truncates an input string to the given length and add a truncate string (if truncated). The truncate string counts to the target length. If no length is specified, it will be truncated to 50 characters. If no truncate string is given, the default is …

Example:


{{ 'Hello world, this is my first text which I want to share with you!' | truncate }}
{{ 'Hello world, this is my first text which I want to share with you!' | truncate: 8 }}
{{ 'Hello world, this is my first text which I want to share with you!' | truncate: 10, '>' }}
		

Output:


Hello world, this is my first text which I want...
Hello...
Hello wor>
		

 

truncate_words & truncatewords

This filter operates similarly to the truncate filter, but truncates after a given number of words instead of characters. The parameters are the number of words after which to truncate and the truncation string (which defaults to …). If no number of words is specified, it will truncate after 15 words.

Example:


{{ 'Hello world, this is my first text which I want to share with you and your friends!' | truncate_words }}
{{ 'Hello world, this is my first text which I want to share with you and your friends!' | truncate_words: 8 }}
{{ 'Hello world, this is my first text which I want to share with you and your friends!' | truncate_words: 10, '>' }}
		

Output:


Hello world, this is my first text which I want to share with you and...
Hello world, this is my first text which...
Hello world, this is my first text which I want>
		

 

upcase

Converts the input string in uppercase.

Example:


{{ 'Hello world!' | upcase }}
		

Output:


HELLO WORLD!
		

Math Filters

Math filter work on numbers (either integer or float) and will transform the (numerical) input to a (numerical) output. Please remark that the output of the decimal point of floats depends on the localization (most often either a dot or a comma is used as decimal point).

Quite often float results are quite imprecise, e.g. 4 - 1.2 is 2,79999995231628. Even though the value is quite correct (as 2,7999999… is actually 2.8), if you want to output the value somewhere on the web page, you should round the value to a given number of decimal places using the round filter. E.g. {{ 4 | minus: 1.2 | round: 1 }} will output 2.8.

ceil

The ceil filter will return the next integer number (of type float) which is larger or equal than the input.

Example:


{{ 3.2 | ceil }}
{{ 4.0 | ceil }}
		

Output:


4
4
	

 

divided_by

This filter divides the input by the additional parameter. The operation of this filter depends on whether the input values are ints or at least one of them is a float. If both operands are int, the result will also be an int (thus 5/2 will result in 2, as it will be rounded down to the next integer). Otherwise the result is a float with decimal places.

Example:


{{ 5 | divided_by: 2 }}
{{ 5.0 | divided_by: 2.0 }}
{{ 5 | divided_by: 2.0 }}
	

Output:


2
2,5
2,5
	

 

floor

The floor filter will return the next integer number (of type float) which is smaller or equal than the input.

Example:


{{ 4.8 | floor }}
{{ 4.0 | floor }}
	

Output:

4 4

 

minus

Substracts the parameter from the input. A float result may be subject to calculation imprecision (as can be seen in the example).

Example:


{{ 4 | minus: 1 }}
{{ 4 | minus: 1.2 }}
	

Output:


3
2,79999995231628
	

 

modulo

Modulo calculates the remainder of the division of the input with the parameter. Most often this operation is used with ints, but this operation also works with floats.

Example:


{{ 5 | modulo: 3 }}
{{ 5.1 | modulo: 2.3 }}
{{ -5 | modulo: 3 }}
	

Output:


2
0,5
-2
	

 

plus

Adds the input and the parameter.

Example:


{{ 5 | plus: 3 }}
{{ 5.1 | plus: 2.3 }}
	

Output:


8
7,4
	

 

round

This filter rounds the input either to the nearest integer, or when a parameter is specified to the given number of decimal points.

Example:


{{ 4.6 | round }}
{{ 4.6352 | round: 2 }}
	

Output:


5
4,64
	

 

times

The times filter can be used with numbers and strings as input, but the filter have different meanings for the two cases. While it reproduces the given string as many times as specified as parameter, it will on the other hand multiply an input number with the parameter number.

Example:


{{ 4 | times: 3 }}
{{ 4.25 | times: 5 }}
	

Output:


12
21,25