> For the complete documentation index, see [llms.txt](https://design-packs.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://design-packs.gitbook.io/docs/fundamentals/block-settings/contexts-block.md).

# Contexts block

> ℹ️ **Availability:** The Contexts block is only available inside Design Packs sections that support **nested blocks (flexible blocks)**. If you don’t see it in the “Add block” menu, the section you’re editing doesn’t support flexible blocks — add it from one that does.

**Show the right content to the right shopper — no apps, no code.**

A flash sale that switches itself on and off. Members-only perks. A “notify me when it’s back” prompt that only appears when something’s sold out. The right shipping message for each country. The Contexts block makes your storefront react to **who’s viewing, when, where, and which product they’re looking at**.

Below is a **recipe book** — pick the result you want, copy the recipe, done. The how-it-works details and full settings reference are at the [bottom](file:///Applications/Quiver.app/Contents/Resources/dist/preview.html#how-it-works).

>

***

### 🗓 Time it perfectly

#### Run a flash sale that turns itself on and off

Put your sale banner up automatically when the sale starts — and take it down the moment it ends.

* **Recipe:** *Date & time* → **Show target**
* **Set:** Start `2026-07-04`, End `2026-07-07 23:59`, your time zone.
* Point the Contexts block at the banner (the whole section, or a custom selector).

#### Auto-hide a shipping cut-off notice

Show “Order by Dec 20 for Christmas delivery” — and have it disappear on its own once the deadline passes.

* **Recipe:** *Date & time* → **Show target**
* **Set:** End `2026-12-20`. Leave Start blank (starts today).

#### Tease a launch, then reveal it

Show a “Coming soon” teaser until launch day, then automatically swap in the real product CTA.

* **Teaser:** *Date & time* → **Show target**, End = launch date.
* **Real content:** a second Contexts block → *Date & time* → **Show target**, Start = launch date.

***

### 👤 Speak to each customer

#### Members-only perks

Show loyalty rewards, members’ pricing, or an account dashboard link only to logged-in shoppers.

* **Recipe:** *Customer status* → **Show target**, set to **Logged in**.

#### “Log in for wholesale pricing” (guests only)

Invite guests to sign in, without nagging people who already have.

* **Recipe:** *Customer status* → **Show target**, set to **Logged out**.

#### Hide “Create an account” from existing customers

* **Recipe:** *Customer status* → **Hide target**, set to **Logged in**.

#### VIP content for your best customers

Reveal early access or a thank-you offer to shoppers who’ve spent over a threshold.

* **Recipe:** *Customer attribute* → **Show target**
* **Set:** Attribute *Total spent*, *Greater than or equal*, value `200` (= $200 in your store currency).

#### First-order welcome offer

Show a “10% off your first order” block — but only to people who haven’t ordered yet.

* **Recipe:** *Customer attribute* → **Show target**
* **Set:** Attribute *Orders count*, *Equal to*, value `0`.

#### Wholesale / B2B content for tagged customers

* **Recipe:** *Customer attribute* → **Show target**
* **Set:** Attribute *Tags*, value `wholesale` (comma-separate for several, e.g. `wholesale, b2b`).

#### Newsletter nudge for non-subscribers

Show a sign-up prompt only to customers who aren’t subscribed yet.

* **Recipe:** *Customer attribute* → **Show target**
* **Set:** Attribute *Accepts marketing*, value **No**.

***

### 🌍 Get local

#### The right free-shipping threshold per currency

Show “Free shipping over $$75”toUSDshoppersand“over$$100” to CAD shoppers — same spot, correct number.

* **Recipe:** one Contexts block per message, each *Currency* → **Show target** (e.g. `USD`, then `CAD`).

#### Region- or language-specific announcements

Show a translated banner or note only where it applies.

* **Recipe:** *Language* → **Show target**, codes like `fr` (comma-separate for several).

***

### 🛍 React to the product

> These read the **current product** (on a product page) or the **product chosen on the section** (like a Featured product section).

#### “Notify me when it’s back” — only when sold out

* **Recipe:** *Product value* → **Show target**, value *Availability* → **Out of stock**.

#### A sale flash only on discounted products

* **Recipe:** *Product value* → **Show target**, value *On sale* → **On sale**.

#### “Add a free gift on orders over $100” — only on pricier items

* **Recipe:** *Product value* → **Show target**, value *Price*, *Greater than or equal*, `100`.

#### Care guide or sizing note by product type or vendor

* **Recipe:** *Product value* → **Show target**, value *Product type* (e.g. `Footwear`) or *Vendor*.

#### A “Final sale” disclaimer for clearance items

* **Recipe:** *Product value* → **Show target**, value *In collection* `clearance` — or *Tag* `final-sale`.

#### Badges driven by your own product fields (metafields)

Show a “Handmade”, country-of-origin, warranty, or allergen callout based on a product **metafield** your team fills in.

* **Recipe:** *Product metafield* → **Show target**
* **Examples:** `custom.handmade` *Is true* · `custom.origin` *Has a value* · `custom.warranty_years` *Greater than* `0` · `custom.allergens`*Contains* `nuts`.

***

### 🔗 Reward your campaigns

#### An exclusive offer for people from a campaign link

Show a special block only to visitors arriving via your campaign URL (e.g. `…/?utm_campaign=vip`).

* **Recipe:** *URL parameter* → **Show target**, name `utm_campaign`, value `vip`.

#### A clean “embed” mode

Hide your nav/banner when the page is opened with a flag like `?embed=true`.

* **Recipe:** *URL parameter* → **Hide target**, name `embed`, value `true`.

***

***

### How it works

The Contexts block is a small piece of logic you drop into a section. It doesn’t display anything itself — it watches a **condition** and, when that condition is met, **shows or hides a target**.

1. **Add the Contexts block** to a section (under *Design Packs: Logic*).
2. **Choose what it applies to** (the target):
   * **Entire section** – the section the Contexts block sits in.
   * **Direct parent** – the block the Contexts block is placed inside.
   * **Custom CSS selector** – any element by class/ID (e.g. `.holiday-banner`). Tick *Apply within section only* so it can’t affect the rest of the site.
3. **Add one or more conditions** (the recipes above). Each has a **Context type**, a **Show / Hide** action, and its settings.

> **Show vs. Hide — the one thing to get right.**
>
> * **Show target** → shown **only when** the condition matches; hidden otherwise.
> * **Hide target** → hidden **only when** the condition matches; shown otherwise.

> 📷 ***Screenshot:** the “Apply to” setting (Entire section / Direct parent / Custom CSS selector).*

#### ⚠️ Visibility, not security

Hidden content is removed from view with CSS, but **still exists in the page source**. Use Contexts for merchandising and presentation — **never** to hide prices, discounts, or anything that must stay genuinely private.

#### Stacking conditions on one target

* **Multiple “Show target” → AND** — shows only when **every** condition matches.
* **Multiple “Hide target” → OR** — hides if **any** condition matches.
* For a simple “or”, use **comma-separated values** within one condition (tags, currencies, languages, vendors, collection handles).

***

### Settings reference

| Context type           | What it checks                                                         | Notes                                                                                                                                                                               |
| ---------------------- | ---------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Date & time**        | A start → end window                                                   | Dates are `YYYY-MM-DD`; add a 24‑hour time like `2026-07-04 09:00` for precision. Set the **Time zone** (UTC offset, e.g. `-05:00`). Blank Start = today; blank End = one year out. |
| **Customer status**    | Logged in / out                                                        | —                                                                                                                                                                                   |
| **Customer attribute** | Orders count, Total spent, Account age, Tags, Accepts marketing        | Only evaluates for logged-in customers. *Total spent* and the *Price* values are in your **store currency** (e.g. `50` = $50). Operators: equal / greater / ≥ / less / ≤ / between. |
| **Currency**           | Active currency                                                        | ISO codes, comma-separated (`USD, CAD`).                                                                                                                                            |
| **Language**           | Storefront language                                                    | ISO codes, comma-separated (`en, fr`).                                                                                                                                              |
| **Product value**      | Availability, On sale, Price, Tag, Product type, Vendor, In collection | Uses the current/section product. *In collection* takes collection **handles** (e.g. `summer-sale`). Lists match **any**.                                                           |
| **Product metafield**  | A product metafield (`namespace` + `key`)                              | Conditions: has a value / has no value / equal / not equal / contains / greater / less / is true / is false. The **Value** field is only used by the comparison conditions.         |
| **URL parameter**      | A `?name=value` in the URL                                             | Optional case-sensitivity.                                                                                                                                                          |

**Good to know:** *Date & time* and *URL parameter* are checked in the shopper’s browser (so they stay accurate even on cached pages, with a brief beat before content appears/disappears). *Currency, language, customer, and product* are decided on the server — instant, no flicker.

***

*Part of the Design Packs block library. Questions? Email* [***info@design-packs.com***](mailto:info@design-packs.com)*.*
