# Day 26/2

Plan 26/2:&#x20;

* learning and researching Shopify doc (architecture, Liquid)
* customize speed

### Layouts

Layouts are the base of the theme, they are liquid files allow you to include content that repeat on multiple page type

#### Layout type

* General: general layouts can apply to all non-checkout pages. Default layout file is `theme.liquid`
* Checkout: `checkout.liquid` layout renders the checkout and is vailable only to Shopify Plus merchants. This type apply to checkout pages&#x20;

#### Schema

Layout file should follow the structure of a standard HTML doc. Most layout files contain the following Liquid objects:

* content\_for\_header

This variable is typically used to include content that should be placed within the `<head>` section of the HTML document. It allows developers to add meta tags, scripts, stylesheets, or any other content that needs to be included in the header of every page.

* content\_for\_layout

This variable is used to inject content into the main content area of the theme layout.

It allows developers to include dynamic content or sections that should be displayed consistently across different pages of the website.

Developers can use the "content\_for\_layout" variable within layout files to define where the main content of each page should be rendered.

## <mark style="color:blue;">Liquid</mark>

### Tags

Tags are wrapped with curly brace percentage delimiters `{% %}`. The text within the delimiters doesn't produce visible output when rendered.

### Conditional tags

#### 1. 'if'  : Renders an expression if a specific condition is `true`.

<mark style="color:green;">`{% if condition %}`</mark>

`expression`

<mark style="color:green;">`{% endif %}`</mark>

#### 2. 'elsif' : check for multiple condition

<mark style="color:green;">`{% if condition %}`</mark>

`expression`

`{% elsif condition %}`

`expression`

<mark style="color:green;">`{% endif %}`</mark>

#### 3. 'else' : set a default expression when no other condition are met

<mark style="color:green;">`{% if condition %}`</mark>

`expression`

`{% else %}`

`expression`

<mark style="color:green;">`{% endif %}`</mark>

#### 4. 'unless' : renders an expression unless a specific condition is `true`

<mark style="color:green;">`{% unless condition %}`</mark>

`expression`

<mark style="color:green;">`{% endunless %}`</mark>

#### 5. 'case' : Renders a specific expression depending on the value of a specific variable

<mark style="color:green;">`{% case variable %}`</mark>

`{% when value1 %}`

`expression1`

`{% when value2 %}`

`expression2`

`{% else %}`

`expression3`

<mark style="color:green;">`{% endcase %}`</mark>

#### 6. 'multiple value' : When multiple values are provided, the expression is returned when the variable matches any of the values inside of the tag.

<mark style="color:green;">`{% case variable %}`</mark>

`{% when value1 or value2 or value3 %}`

`expression1`

`{% when value4, value5, value6 %}`

`expression2`

`{% else %}`

`expression3`

<mark style="color:green;">`{% endcase %}`</mark>

Provide the values as a comma-separated list, or separate them using an `or` operator.

### HTML tags

#### form&#x20;

Generate many types html `<form>` tag including any required `<input>` to submit the form.&#x20;

`{% form 'form_type' %}`

`content`

`{% endform %}`

Form types:&#x20;

* activate\_customer\_password : activating a customer account
* cart : creating a checkout based on the items currently in the cart
* contact : submitting an email to the merchant
* create\_customer : creating a new customer account
* currency : select preferred currency
* customer : creating a new customer without registering a new account
* customer\_address : generates a form for creating a new address on a customer account, or editing an existing one
* customer\_login : generates a form for logging into a customer account
* guest\_login : Generates a form that directs customers back to their checkout session as a guest instead of logging in to an account
* localization : Generates a form for customers to select their preferred country so that they're shown the appropriate language and currency
* new\_comment&#x20;
* product&#x20;
* recover\_customer\_password&#x20;
* reset\_customer\_password&#x20;
* storefront\_password


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dtian.gitbook.io/daily-report-1/day-26-2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
