Liquid Flashcards

1
Q

What is a handle?

A

A handle is a URL-friendly identifier automatically generated from an object’s title. It’s lowercase, spaces become hyphens, and special characters are removed.

```html
<a>{{ product.title }}</a>
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the {% assign %} tag?

A

Assigns a value to a new or existing variable. Commonly used to store strings, numbers, or arrays for later use.

```liquid
{% assign greeting = “Hello” %}

<p>{{ greeting }} world!</p>

~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the {% capture %} tag?

A

Captures everything between the tag into a variable, including multi-line text or HTML.

```liquid
{% capture my_content %}

<h2>Welcome!</h2>

<p>Thanks for visiting.</p>

{% endcapture %}
{{ my_content }}
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What do {% if %} and {% unless %} tags do?

A

Conditional tags that execute code only if (or unless) a condition is true. Often combined with elsif and else.

```liquid
{% if product.available %}

<p>This product is in stock!</p>

{% else %}

<p>Out of stock</p>

{% endif %}
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are operators in Liquid?

A

Used inside conditionals to compare values, check equality/inequality, or see if a string/array contains a value.

```liquid
{% if customer.tags contains “VIP” %}

<p>Welcome, VIP customer!</p>

{% endif %}
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does the {% for %} tag do?

A

Iterates over an array or collection. The forloop object provides details like forloop.index and forloop.first.

```liquid
{% for product in collection.products %}

<p>{{ forloop.index }}. {{ product.title }}</p>

{% endfor %}
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What do {% break %} and {% continue %} tags do?

A

break stops the current loop immediately, while continue skips the rest of the current iteration and moves to the next.

```liquid
{% for i in (1..5) %}
{% if i == 3 %}
{% continue %}
{% endif %}
{{ i }}
{% endfor %}
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does {% increment %} do?

A

Auto-creates and updates a counter variable. increment adds 1 each time it’s called; decrement subtracts 1.

```liquid
{% increment counter %} <!-- First call sets counter=1 -->
{% increment counter %} <!-- Next call sets counter=2 -->
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is whitespace control in Liquid?

A

Adding a hyphen in the tag syntax ({{- }}, {%- %}) removes surrounding whitespace/newlines, helping keep HTML clean.

```liquid
{% for product in collection.products -%}
{{- product.title -}}
{%- endfor %}
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the shop object?

A

A global object with store details, such as shop.name, shop.domain, shop.currency, and more.

```html

<p>Store: {{ shop.name }}</p>

<p>Domain: {{ shop.domain }}</p>

~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does the product object represent?

A

Represents a product in Shopify. Has attributes like title, price, variants, images, etc.

```html

<h1>{{ product.title }}</h1>

<p>Price: {{ product.price | money }}</p>

~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a collection in Liquid?

A

A grouping of products. Provides collection.title, collection.description, collection.products, etc.

```html

<h2>{{ collection.title }}</h2>

<p>{{ collection.description }}</p>

~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does the cart object represent?

A

A global object that represents the customer’s cart, with cart.items, cart.total_price, cart.item_count, etc.

```html

<p>Items in cart: {{ cart.item_count }}</p>

<p>Total: {{ cart.total_price | money }}</p>

~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is a line item?

A

Each unique product variant in the cart is a line item. Contains title, quantity, line_item.product, etc.

```liquid
{% for item in cart.items %}

<p>{{ item.title }} x {{ item.quantity }}</p>

{% endfor %}
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What does all_products do?

A

Lets you access any product by its handle: all_products[‘handle’]. Useful for referencing products not in the current context.

```liquid
{% assign my_product = all_products[‘red-shirt’] %}

<p>{{ my_product.title }}</p>

~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the page object?

A

Represents a standalone page (from Online Store > Pages). Offers fields like page.title and page.content.

```html

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

<div>{{ page.content }}</div>

~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What does the blog object contain?

A

A blog object containing multiple articles. Attributes include blog.title, blog.articles, etc.

```html

<h2>{{ blog.title }}</h2>

{% for article in blog.articles %}

<p>{{ article.title }}</p>

{% endfor %}
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is an article in Liquid?

A

A single blog article, with properties like title, content, author, and more.

```html

<h3>{{ article.title }}</h3>

<div>{{ article.content }}</div>

<p>Author: {{ article.author }}</p>

~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What does the customer object represent?

A

The logged-in customer object, if any. Contains customer.first_name, customer.orders, customer.email, etc.

```liquid
{% if customer %}

<p>Hello, {{ customer.first_name }}!</p>

{% endif %}
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is a section in Liquid?

A

Represents a theme section, including section.settings and section.blocks. Used in .liquid section files.

```liquid
{% for block in section.blocks %}

<div>{{ block.settings.heading }}</div>

{% endfor %}
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is a block in Liquid?

A

Each block inside a section. Has an ID, a type, and its own settings.

```html

<div>
{{ block.settings.content }}
</div>

~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What does the image object represent?

A

Represents an image, typically accessed via product.images or article.image. Provides src, alt, width, height.

```html
<img></img>
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What is the media object?

A

An abstract object for product.media entries (images, videos, 3D models). Often includes a preview_image.

```liquid
{% for media_item in product.media %}
{% if media_item.media_type == ‘image’ %}
<img></img>
{% endif %}
{% endfor %}
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What does the focal_point do?

A

Determines the important x/y region of an image so it stays visible when cropped.

```html

<p>Focal point: X={{ focal_point.x }}, Y={{ focal_point.y }}</p>

~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What is a metafield?

A

A custom data field stored on Shopify resources (product, collection, etc.). Access with resource.metafields.namespace.key.

```html

<p>{{ product.metafields.custom_fields.size_chart }}</p>

~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

What do settings provide access to?

A

Provides access to theme settings defined in settings_schema.json. Typically used for brand colors, text, etc.

```html

<style>

  body { background-color: {{ settings.background_color }}; }
</style>

~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

What is the template object?

A

Contains info about the current template (e.g. template.name), helpful for conditional logic based on template.

```html

<p>Rendering template: {{ template }}</p>

~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

What is page_title?

A

The title of the current page, often used in <title> or meta tags for SEO.</title>

```html

<title>{{ page_title }}</title>

~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

What are current_tags?

A

An array of tags currently filtering a collection or blog page.

```liquid
{% for tag in current_tags %}
<span>{{ tag }}</span>
{% endfor %}
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

What are money filters?

A

Format numeric values as currency (e.g., money, money_without_currency).

```liquid
{{ product.price | money }} <!-- e.g. $10.00 -->
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

What are array filters?

A

Manipulate arrays (sort, filter, merge). Examples include map, sort, uniq, concat, where.

```liquid
{% assign titles = collection.products | map: ‘title’ | sort %}
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

What are string filters?

A

Modify strings (uppercase, truncate, replace, etc.). Examples: upcase, downcase, truncate.

```liquid
{{ “hello world” | upcase }} <!-- "HELLO WORLD" -->
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

What are color filters?

A

Adjust or extract color properties (e.g., color_darken, color_lighten). Often used on theme color settings.

```liquid
{{ settings.header_color | color_lighten: 10 }}
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

What are localization filters?

A

Handle multi-language/currency tasks. Includes currency_selector, format_address, t.

```liquid
{{ ‘general.greeting’ | t }}
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

What are math filters?

A

Perform arithmetic on numbers: plus, minus, times, divided_by, round.

```liquid
{{ product.price | times: 2 | money }}
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

What are default filters?

A

Provide fallback values, like default and default_errors.

```liquid
{{ customer.first_name | default: “Guest” }}
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

What are HTML filters?

A

Create HTML tags from strings or URLs. Includes link_to, script_tag, time_tag.

```liquid
{{ “https://example.com” | link_to: “Visit Our Site” }}
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

What do metafield_tag and metafield_text do?

A

Output metafield data as HTML or plain text.

```liquid
{{ product.metafields.custom_fields.info | metafield_text }}
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

What is the contains operator?

A

Checks if a string or array contains a specific substring/item.

```liquid
{% if “hello world” contains “world” %}

<p>Yes, it’s included.</p>

{% endif %}
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q

What does the form tag do?

A

Used within {% form %} tags for building forms (contact, account creation, etc.). Contains fields like form.errors, form.email.

```liquid
{% form ‘create_customer’ %}
<input></input>
<input></input>
{% endform %}
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q

What is a linklist?

A

A navigation menu from the Shopify admin. Contains an array of link objects.

```liquid
{% for link in linklists.main-menu.links %}
<a>{{ link.title }}</a>
{% endfor %}
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
42
Q

What is a link?

A

An individual menu item within a linklist, with url, title, object, etc.

```html
<a>{{ link.title }}</a>
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
43
Q

What are routes?

A

Generates dynamic URLs for key pages (cart, account, search), so they remain valid if Shopify’s URL structure changes.

```html
<a>My Account</a>
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
44
Q

What do customer_login_link and customer_logout_link do?

A

Filters that generate login/logout URLs for customers.

```liquid
{{ ‘Log In’ | customer_login_link }}
{{ ‘Log Out’ | customer_logout_link }}
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
45
Q

What does current_page represent?

A

The current page number in a paginated loop. Useful for building pagination UIs.

```html

<p>Page {{ current_page }} of {{ paginate.pages }}</p>

~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
46
Q

What is pagination?

A

Created by {% paginate %}. Splits a collection into multiple pages, providing paginate.parts, paginate.next, etc.

```liquid
{% paginate collection.products by 8 %}
{% for product in collection.products %}
{{ product.title }}
{% endfor %}
{% endpaginate %}
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
47
Q

What is content_for_additional_checkout_buttons?

A

Outputs offsite payment buttons (like PayPal) if enabled, typically displayed near ‘Checkout.’

```liquid
{{ content_for_additional_checkout_buttons }}
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
48
Q

What does content_for_layout render?

A

Liquid placeholders that render the main content of the current template or the home page.

```liquid
<!-- In theme.liquid -->
{{ content_for_layout }}
~~~

49
Q

What does powered_by_link output?

A

Outputs a localized “Powered by Shopify” link. Often placed in the footer.

```html

<p>{{ powered_by_link }}</p>

~~~

50
Q

What is the checkout object?

A

Available on the order status page or checkout.liquid (Shopify Plus). Includes info like checkout.line_items, checkout.total_price.

```html

<p>Checkout ID: {{ checkout.id }}</p>

~~~

51
Q

What does search provide?

A

Provide data about search queries, results, and resource types.

```liquid
{% if search.performed %}

<p>Found {{ search.results_count }} results for "{{ search.terms }}"</p>

{% endif %}
~~~

52
Q

What is metafield_definition?

A

Used to store and retrieve custom data structures. Access entries via metaobject.system.handle or resource.metafields.

```liquid
{{ metaobject.system.handle }} <!-- e.g. "recipe-apple-pie" -->
~~~

53
Q

What are selling_plan and selling_plan_group?

A

Related to subscriptions or recurring purchases. Provide details on recurring pricing or shipping intervals.

```liquid
{% if product.selling_plan_groups.size > 0 %}

<p>Subscription options available!</p>

{% endif %}
~~~

54
Q

What do robots and rule customize?

A

For customizing robots.txt directives (SEO/crawler instructions). Rarely changed in standard themes.

```liquid
{% for group in robots.default_groups %}
{% for rule in group.rules %}
{{ rule.directive }}: {{ rule.value }}
{% endfor %}
{% endfor %}
~~~

55
Q

What is the script object?

A

Contains info about Shopify Scripts (Shopify Plus feature for advanced cart/checkout logic).

```html

<p>Script ID: {{ script.id }}</p>

~~~

56
Q

What do fulfillment and shipping_method provide?

A

Provide shipping and fulfillment data for orders.

```liquid
{% for fulfillment in order.fulfillments %}

<p>Tracking: {{ fulfillment.tracking_number }}</p>

{% endfor %}
~~~

57
Q

What are video, external_video, and model?

A

Advanced media types in product.media. Videos or 3D models can be rendered with appropriate tags.

```liquid
{% if media_item.media_type == ‘video’ %}

<video></video>

{% endif %}
~~~

58
Q

What does localization handle?

A

Used for multi-language or multi-currency features, letting you display store content in different locales.

```html

<p>Current locale: {{ localization.language.iso_code }}</p>

~~~

59
Q

What is routes (revisited for advanced usage)?

A

Useful for generating dynamic URLs to cart, account, search, ensuring future-proof links.

```html
<a>Go to Cart</a>
<a>Search</a>
~~~

60
Q

What is a handle?

A

A handle is a URL-friendly identifier automatically generated from an object’s title. It’s lowercase, spaces become hyphens, and special characters are removed.

If product.title = “Red Shirt”, then product.handle = “red-shirt”

61
Q

What is the assign tag?

A

The assign tag creates or updates a variable with a given value.

{% assign greeting = “Hello” %}

<p>{{ greeting }} world!</p>

62
Q

What is the capture tag?

A

The capture tag stores everything inside into a variable, including multi-line HTML or text.

{% capture my_content %}

<h2>Welcome!</h2>

<p>Thanks for visiting.</p>

{% endcapture %}
{{ my_content }}

63
Q

What are if and unless tags?

A

They’re conditional tags that run code if (or unless) a condition is true. Often paired with elsif or else.

{% if product.available %}

<p>This product is in stock!</p>

{% else %}

<p>Out of stock</p>

{% endif %}

64
Q

What are operators (==, !=, >, <, >=, <=, and, or, contains)?

A

These are used inside conditionals to compare values or check if a string/array contains a substring/item.

{% if customer.tags contains “VIP” %}

<p>Welcome, VIP customer!</p>

{% endif %}

65
Q

What is the for tag (and forloop)?

A

The for tag iterates over an array or collection. The forloop object provides details like index or whether it’s the first/last item.

{% for product in collection.products %}

<p>{{ forloop.index }}. {{ product.title }}</p>

{% endfor %}

66
Q

What are break and continue?

A

Within a for loop, break immediately stops the loop, while continue skips to the next iteration.

{% for i in (1..5) %}
{% if i == 3 %}
{% continue %}
{% endif %}
{{ i }}
{% endfor %}
<!-- Outputs: 1, 2, 4, 5 -->

67
Q

What are increment and decrement?

A

They automatically create and update a counter variable. increment adds 1, decrement subtracts 1.

{% increment counter %} <!-- First call sets counter=1 -->
{% increment counter %} <!-- Next call sets counter=2 -->

68
Q

What is whitespace control?

A

By adding a hyphen in the tag syntax ({{- }}, {%- %}), Liquid strips surrounding whitespace/newlines, helping keep HTML clean.

{% for product in collection.products -%}
{{- product.title -}}
{%- endfor %}

69
Q

What is the shop object?

A

The shop object contains store-wide info, such as shop.name, shop.domain, shop.currency, etc.

<p>Store: {{ shop.name }}</p>

<p>Domain: {{ shop.domain }}</p>

70
Q

What is the product object?

A

Represents a single product. Common attributes include title, price, variants, images, and more.

<h1>{{ product.title }}</h1>

<p>Price: {{ product.price | money }}</p>

71
Q

What is the collection object?

A

A grouping of products with attributes like collection.title, collection.description, and collection.products.

<h2>{{ collection.title }}</h2>

<p>{{ collection.description }}</p>

72
Q

What is the cart object?

A

A global object representing the current shopping cart. Has cart.items, cart.total_price, etc.

<p>Items in cart: {{ cart.item_count }}</p>

<p>Total: {{ cart.total_price | money }}</p>

73
Q

What is a line_item?

A

Each distinct product variant in the cart is a line_item. Includes title, quantity, line_item.product, etc.

{% for item in cart.items %}

<p>{{ item.title }} x {{ item.quantity }}</p>

{% endfor %}

74
Q

What is all_products?

A

Lets you reference any product by its handle: all_products[‘handle’]. Helpful for cross-selling or static references.

{% assign my_product = all_products[‘red-shirt’] %}

<p>{{ my_product.title }}</p>

75
Q

What is a page object?

A

Represents a standalone page (from Online Store > Pages). Has fields like page.title, page.content.

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

<div>{{ page.content }}</div>

76
Q

What is a blog object?

A

Represents a blog in Shopify, containing multiple articles. Attributes include blog.title, blog.articles.

<h2>{{ blog.title }}</h2>

{% for article in blog.articles %}

<p>{{ article.title }}</p>

{% endfor %}

77
Q

What is an article object?

A

A single blog article with properties like title, content, author, and more.

<h3>{{ article.title }}</h3>

<div>{{ article.content }}</div>

<p>Author: {{ article.author }}</p>

78
Q

What is the customer object?

A

Represents a logged-in customer. Provides customer.first_name, customer.email, customer.orders, etc.

{% if customer %}

<p>Hello, {{ customer.first_name }}!</p>

{% endif %}

79
Q

What is a section object?

A

Used in .liquid section files, giving access to section.settings, section.blocks, etc.

{% for block in section.blocks %}

<div>{{ block.settings.heading }}</div>

{% endfor %}

80
Q

What is a block object?

A

Each block within a section. Has an ID, a type, and settings.

<div>
{{ block.settings.content }}
</div>

81
Q

What is an image object?

A

Represents an image, often from product.images or article.image. Provides src, alt, width, and height.

<img></img>

82
Q

What is a media object?

A

A generic media entry in product.media. Could be an image, video, or 3D model. Usually includes a preview_image.

{% for media_item in product.media %}
{% if media_item.media_type == ‘image’ %}
<img></img>
{% endif %}
{% endfor %}

83
Q

What is a focal_point?

A

The x/y coordinate that remains visible when an image is cropped.

<p>Focal point: X={{ focal_point.x }}, Y={{ focal_point.y }}</p>

84
Q

What is a metafield?

A

A custom data field stored on Shopify resources. Accessed via resource.metafields.namespace.key.

<p>{{ product.metafields.custom_fields.size_chart }}</p>

85
Q

What is settings?

A

Exposes theme settings from settings_schema.json. Often used for colors, text, or layout options.

<style>

   body { background-color: {{ settings.background_color }}; }
 
</style>
86
Q

What is a template object?

A

Contains details about the current template, like template.name or template.suffix.

<p>Rendering template: {{ template }}</p>

87
Q

What is page_title?

A

The current page’s title, often used in the <title> tag for SEO or browser tabs.</title>

<title>{{ page_title }}</title>

88
Q

What are current_tags?

A

An array of tags currently used to filter a collection or blog page.

{% for tag in current_tags %}
<span>{{ tag }}</span>
{% endfor %}

89
Q

What are money filters?

A

Format numeric values as currency (e.g., money, money_without_currency).

{{ product.price | money }} <!-- e.g. $10.00 -->

90
Q

What are array filters?

A

Filters that manipulate arrays (e.g., map, sort, uniq, concat, where).

{% assign titles = collection.products | map: ‘title’ | sort %}

91
Q

What are string filters?

A

Filters that modify strings (uppercase, truncate, replace, etc.). Examples: upcase, downcase, truncate.

{{ “hello world” | upcase }} <!-- "HELLO WORLD" -->

92
Q

What are color filters?

A

Used to modify or extract color properties, such as color_darken, color_lighten, etc.

{{ settings.header_color | color_lighten: 10 }}

93
Q

What are localization filters?

A

Handle multi-language or multi-currency tasks. Includes currency_selector, format_address, t.

{{ ‘general.greeting’ | t }}

94
Q

What are math filters?

A

Perform arithmetic on numbers (e.g. plus, minus, times, divided_by, round).

{{ product.price | times: 2 | money }}

95
Q

What are default filters?

A

Provide fallback values, like default or default_errors.

{{ customer.first_name | default: “Guest” }}

96
Q

What are HTML filters?

A

Create HTML tags from strings or URLs. Examples: link_to, script_tag, time_tag.

{{ “https://example.com” | link_to: “Visit Our Site” }}

97
Q

What are metafield_tag and metafield_text?

A

Filters that output metafield data as HTML or plain text.

{{ product.metafields.custom_fields.info | metafield_text }}

98
Q

What is the contains operator in filters?

A

Checks if a string or array contains a specific substring/item. Often used in conditionals.

{% if “hello world” contains “world” %}

<p>Yes, it’s included.</p>

{% endif %}

99
Q

What is a form object?

A

Used inside {% form %} tags for building forms (contact, account creation). Has fields like form.errors, form.email.

{% form ‘create_customer’ %}
<input></input>
<input></input>
{% endform %}

100
Q

What is a linklist?

A

A Shopify navigation menu. Contains an array of link objects.

{% for link in linklists.main-menu.links %}
<a>{{ link.title }}</a>
{% endfor %}

101
Q

What is a link object?

A

An individual menu item within a linklist, with url, title, object, etc.

<a>{{ link.title }}</a>

102
Q

What is routes?

A

A set of dynamic URLs (e.g. routes.cart_url) ensuring your theme remains valid if Shopify changes URL structures.

<a>My Account</a>

103
Q

What are customer_login_link and customer_logout_link?

A

Filters that generate login/logout URLs for customer accounts.

{{ ‘Log In’ | customer_login_link }}
{{ ‘Log Out’ | customer_logout_link }}

104
Q

What is current_page?

A

The current page number in a paginated collection or array.

<p>Page {{ current_page }} of {{ paginate.pages }}</p>

105
Q

What is pagination?

A

Created by {% paginate %}, splitting a collection into multiple pages.

{% paginate collection.products by 8 %}
{% for product in collection.products %}
{{ product.title }}
{% endfor %}
{% endpaginate %}

106
Q

What is content_for_additional_checkout_buttons?

A

Outputs offsite payment buttons (like PayPal) if available, typically placed near checkout.

{{ content_for_additional_checkout_buttons }}

107
Q

What are content_for_layout and content_for_index?

A

Placeholders that dynamically render the main content of a template or the homepage.

<!-- In theme.liquid -->
{{ content_for_layout }}

108
Q

What is powered_by_link?

A

Outputs a localized “Powered by Shopify” link, usually placed in a footer.

<p>{{ powered_by_link }}</p>

109
Q

What is the checkout object?

A

Available in the order status page or checkout.liquid (Shopify Plus). Provides details like checkout.line_items, checkout.total_price.

<p>Checkout ID: {{ checkout.id }}</p>

110
Q

What are search and predictive_search?

A

Objects that provide data about search queries, results, and resource types.

{% if search.performed %}

<p>Found {{ search.results_count }} results for "{{ search.terms }}"</p>

{% endif %}

111
Q

What are metafield_definition and metaobject?

A

Used to store and retrieve custom data structures in Shopify. Access entries via metaobject.system.handle or resource.metafields.

{{ metaobject.system.handle }} <!-- e.g. "recipe-apple-pie" -->

112
Q

What are selling_plan and selling_plan_group?

A

Related to subscriptions or recurring purchases, detailing recurring pricing or shipping intervals.

{% if product.selling_plan_groups.size > 0 %}

<p>Subscription options available!</p>

{% endif %}

113
Q

What are robots and rule?

A

For customizing robots.txt (SEO/crawler instructions). Rarely changed in standard themes.

{% for group in robots.default_groups %}
{% for rule in group.rules %}
{{ rule.directive }}: {{ rule.value }}
{% endfor %}
{% endfor %}

114
Q

What is a script object?

A

Contains info about Shopify Scripts (Shopify Plus feature for custom cart/checkout logic).

<p>Script ID: {{ script.id }}</p>

115
Q

What are fulfillment and shipping_method?

A

Provide shipping and fulfillment details on orders, such as tracking info or shipping costs.

{% for fulfillment in order.fulfillments %}

<p>Tracking: {{ fulfillment.tracking_number }}</p>

{% endfor %}

116
Q

What are video, external_video, and model?

A

Advanced media types in product.media for videos or 3D models.

{% if media_item.media_type == ‘video’ %}

<video></video>

{% endif %}

117
Q

What is localization/country/shop_locale?

A

Used for multi-language or multi-currency setups, letting you display content in different locales.

<p>Current locale: {{ localization.language.iso_code }}</p>

118
Q

What is advanced routes usage?

A

Using routes for dynamic URLs to cart, search, etc., ensuring future-proof links.

<a>Go to Cart</a>
<a>Search</a>