Skip to content

Theme blocks

The app adds three app blocks to any Online Store 2.0 theme. You place them in the theme editor like any section, and they adapt to the theme: they take their section’s fonts, colors and color scheme, and only add the layout they need and what accessibility requires.

This page is for the agency or developer who integrates the app into a theme. It explains which block goes where, how to set each one up for the brand and the theme, and how to change their look in a few lines of CSS. Each setting in detail is at the end of each part.

Block For Where to place it
Store locator Finding the nearest store: a map, a search, filters. The right choice as soon as the brand has dozens of stores or several countries. On a page’s template, for example “Our stores”.
Store page Giving each store its own page, indexed by search engines: photos, hours, directions. On the Store page template, once: every page uses it.
Store list Showing every store at a glance, by country, type or in one grid, without a map. Ideal for a brand in a few countries, or for an “Our stores in France” or “Our stockists” page. On a page’s template, instead of the store locator or under it.
Country or city page A page per country, and per city, listing its stores, indexed by search engines. On the Store hub page template, shared by the country and city pages.
Country and city list The links to the country pages, and their city pages. Under the store locator, or on an “All our stores” page: the country and city pages link their own.

The blocks are served by Shopify, with the page: they stay online even if the app is unavailable. They only show active stores, each on the channels checked on its page in the app (the store locator, its page, or both). The map style and the markers come from the app’s Settings, shared by the whole shop. The maps are OpenStreetMap’s by default, or Mapbox’s or Google Maps’ with the merchant’s own key.

The visitor lands on a map already framed on their area, and the list next to it shows the stores on the map, following each move or zoom; a search or Near me frames a new area, the filters never move the map. On a computer, the list takes the left third and the map the right two thirds; on a phone, a search line, a short map, then the list, which scrolls in its own box. The Map | List buttons switch to the List view: the list alone, across the page’s width (three columns on a computer), without loading the map; tapping a store opens the map on it again.

A world map with three dots tells the visitor nothing, and an empty map even less. The Map view on arrival setting decides the area framed on first display; If no store in that area decides the fallback when that area is empty.

The brand… Set Map view on arrival to
sells in several countries with Shopify Markets, and each market has its stores Market of the online store: the country chosen in the theme’s country selector.
has a single online store for visitors from several countries Visitor’s position (the default): the country of their connection, or their exact position if they already shared it.
is only in one country Fixed country, with its Country code (FR).
has few stores All stores.

If the area has no store, the map frames by default the Nearest country with stores: a Belgian visitor sees France, a Japanese visitor sees Europe. A sentence under the search tells them, so the map doesn’t look wrong.

The view on arrival only applies once: as soon as the visitor moves the map, or when the link they followed already holds a city or a store, it no longer plays.

The store locator keeps the visitor’s context in the page’s address: their search, the chosen city or store, the filters, the map’s position. A visitor coming back from a store page with the Back button finds the map as they left it, and you can build these addresses yourself, for example for a link from a campaign or a product page:

Link Opens
/pages/our-stores#city=Lyon,FR The map framed on the stores of Lyon.
/pages/our-stores#store=lyon-presqu-ile The map centered on this store (its identifier), popup open.
/pages/our-stores#q=lyon The search “lyon” typed, nothing chosen.
/pages/our-stores#type=Flagship Only the stores of the Flagship type checked. Repeat the parameter for several types.
/pages/our-stores#service=Parking Only the stores with this service.
/pages/our-stores#line=Sunglasses Only the stores with this product line.
/pages/our-stores#at=45.76,4.83,13 The map at this center (latitude, longitude) and zoom.

The type and the service are written as on the store locator, in the page’s language. Join several with & (#city=Lyon,FR&type=Flagship). The context sits after the #, which search engines ignore: a filtered address is never indexed apart, and the page’s canonical URL stays clean, with no robots.txt rule to add. Links written the old way, with ? (?q=lyon), still work.

On a computer, a grid places the search bar and the list in the left column (one third), the map on the right (two thirds). On a phone, the three stack in the HTML’s order, which is also the tab order.

<store-locator class="store-locator">
├─ .store-locator__toolbar search, Near me (.store-locator__near-me, an icon button, its name in a tooltip), filters, the empty list's message (.store-locator__empty), the shortcuts (.store-locator__cities, .store-locator__city-choice), the Map | List buttons (.store-locator__layout; data-layout="list" on the block in the List view)
│ ├─ .store-locator__search the field and its suggestions (.store-locator__suggestions)
│ ├─ .store-locator__results the number of stores (.store-locator__count), the filters button
│ └─ .store-locator__filter-panel the checkboxes, one .store-locator__filter per filter
├─ .store-locator__map the map, its group circles (.store-locator__cluster)
└─ .store-locator__list the list
└─ .store-locator__item a store: __city (a city's heading), __nearest, __head (the name and __distance), __name (its button: __locate), __type, __address,
__actions (__phone, __directions, __page)
Setting Values Default What it does
Title text empty The page’s h1, above the map. Empty: no title.

Map layout

Setting Values Default What it does
Display Map and list, List Map and list The view on arrival. The visitor switches with the Map | List buttons. With List, the map loads only if they open it.
Full page width on / off on The block takes the whole page width, beyond the section’s column.
Space above 0 to 200 px 0 See Fixed header or sections without margins.
Side margin 0 to 80 px 0 Shown when Full page width is off.
Fill the window height on / off on On a computer, the map grows with the window, under what the theme shows above the block, up to the maximum height: no big blank under it on a large screen.
Map height 400 to 1000 px 680 px With Fill the window height: the minimum height. On a phone, the map is 40% of the window’s height, this value at most.
Maximum map height 600 to 1600 px 960 px With Fill the window height: the map stops growing, and the bottom of the page stays in view in a very tall window.
Map on demand on mobile on / off off On mobile, the List view on arrival: the Map button, or a card tapped, opens the map, framed on the visitor’s location or search. On a computer, the Display setting applies.
Store groups on the map Tight, Normal, Wide Normal Stores too close to tell apart become one circle with their number, which zooms in when clicked. Tight: smaller groups, more circles; Wide: fewer circles. No groups in a view of 50 stores or fewer, nor at street level.

Search and filters

Setting Values Default What it does
City shortcuts on / off off Under the search, the 6 cities of the arrival’s country with the most stores, with their number; hidden once the visitor searches or shares their location.
Type filter on / off on Shown from two types. Every type is checked on arrival; stores without a type are never hidden.
Services filter on / off on Shown when a store has a service. Nothing is checked on arrival; only the stores offering every checked service stay.
Product lines filter on / off on The same, for the product lines. A setting of the app (Settings › Map), like the two above.

View on arrival

Setting Values Default
Map view on arrival Market of the online store, Visitor’s position, Fixed country, All stores Visitor’s position
Country code two letters, for example FR; used with Fixed country empty: the market
If no store in that area Nearest country with stores, Country with the most stores, All stores Nearest country with stores

The block makes up a store’s whole page. At the top, the essentials: its type, name, an “Open now” badge at the store’s local time, its address, the Get directions and Call buttons, its services, its product lines and its presentation, beside the main photo. Below, its other photos beside its hours, exceptional hours, contact and access, then the 3 nearest stores. The page has no map: Get directions opens Google Maps. It also describes the store to search engines (see SEO).

It only works on the Store page template, the one of every store page. You can place other theme sections above or below it, and connect them to the store’s data (see Store page template and data).

The store’s name is the page’s h1, with the theme’s h1 class and no size of its own: it takes the theme’s h1 style, which is often larger than the titles of other pages (themes of the Horizon family set those titles with a preset). To give it the same style:

  1. On the Store page template, add your theme’s heading block (“Heading” in Horizon) above the Store page block.
  2. Connect its text to the Name field, with the dynamic source (the small plug icon).
  3. Choose the same style as your other page titles.
  4. In the Store page block, empty the Title field.

The name stays in the page’s structured data, and the link to all stores stays shown.

<article class="store-page">
├─ .store-page__summary .store-page__breadcrumb or .store-page__back (link to all stores), .store-page__type, .store-page__title (the h1),
│ .store-page__address, .store-page__actions (.store-page__button),
│ .store-page__services-block (.store-page__services), .store-page__lines-block, .store-page__description
├─ .store-page__photos the main photo (.store-page__photo--hero), then up to 4 more (.store-page__photo)
├─ .store-page__info the sections (.store-page__section): hours (.store-page__hours, .store-page__special),
│ contact (.store-page__contact, a dl), access (.store-page__access)
└─ .store-page__nearby the nearby stores: .store-card elements
Setting Values Default What it does
Show the title checkbox on Off: no h1, for the theme’s own Heading block above.
Title text empty The page’s h1, shown while Show the title is on. Empty: the store’s name; you can connect it to another field (dynamic source).
Show photos on / off on The main photo beside the summary, the others in a grid beside the hours.
Show nearby stores on / off on The 3 nearest stores with a page, as the crow flies, whatever the country.
Show the link to all stores on / off on A link to the store locator page the app found or created (the store_locator_page metafield of the app, a page reference), at the end of the title’s line. It follows the page when it is renamed. No page: no link. Hidden while the breadcrumb (.store-page__breadcrumb) is shown, turned on in the app’s Settings.
Space above 0 to 200 px 0 See Fixed header or sections without margins.
Side margin 0 to 80 px 0 For a full-width section.

The block’s width follows its section’s width setting (Horizon: Page or Full).

Every store as a grid of cards, without a map: the visitor browses rather than searches. By default, under a heading per country, in the alphabetical order of their name in the visitor’s language; Group by also offers a heading per type, or a single grid. All the content is in the page’s HTML, with a link to each store page: it is also the block search engines read best. The country and city pages have their own block, which shares this one’s rendering: see Country or city page.

For an “Our stores in France” page:

  1. Create the page and its template, then add the Store list block to it.
  2. In Only show these countries, enter FR.
  3. With a single country, the list shows no country heading: only the grid.

For a group of countries, separate the codes with commas: FR, BE, CH. For an “Our stockists” page, enter the type’s name in Only show these store types and group by country.

<store-list class="store-list">
├─ .store-list__header .store-list__title, the block's title
├─ .store-list__controls the row of tools (.store-list__tools: .store-list__filter-toggle, .store-list__count), the filters panel (.store-list__filter-panel)
└─ .store-list__group one per country (or per type)
├─ .store-list__country the group's heading, from two groups
├─ .store-list__grid .store-card elements
└─ .store-list__section grouped by type on a country page: .store-list__section-title, then its .store-list__grid

The filters look the same in the lists and the store locator: their style is in store-filters.css, on the public classes .store-list__filter-* and .store-locator__filter-*.

A card, the same in the list and among a page’s nearby stores:

.store-card
├─ .store-card__photo
├─ .store-card__name the link to the page, stretched over the whole card
├─ .store-card__type, .store-card__address, store-opening-status (the opening status)
└─ .store-card__links .store-card__phone, .store-card__directions
Setting Values Default What it does
Title text “Our stores”, in the theme editor’s language Above the list; empty, no title.

List

Setting Values Default What it does
Country filter on / off on From two countries; hidden when grouped by country.
Type filter on / off on As on the store locator; hidden when grouped by type.
Services filter on / off on As on the store locator.
Product lines filter on / off on As on the store locator.
Group by Nothing, Type, Country Country A heading per country (or per type, in the order of the types in the app’s Settings, the stores without a type last; the cards then leave out the type).
Sort by Name, City, then name, Type, then city Name Within each group.
Only show these countries two-letter country codes, separated by commas empty: every country Limits the list to the stores of these countries.
Only show these store types type names or handles, separated by commas, any case empty: every type Limits the list to the stores of these types; stores without a type are left out. Filtered when Shopify renders the page: the other stores are not sent.
Card size Small, Medium, Large Medium As many cards per row as fit in the section’s width: one on a phone.

Cards content

Setting Default What it does
Show store type on The type under the name.
Show photos on The main photo at the top of the card, or an empty frame to keep the cards aligned.
Show address on The address.
Show opening status on Open or closed now, at the store’s local time. For stores with opening hours.
Show phone link on The phone number, a link to call it.
Show directions link on The directions in Google Maps, in a new tab.

Spacing: Space above (0 to 200 px, 48 by default) and Side margin (0 to 80 px, 0 by default).

The Country or city page block on the “Store hub page” template (metaobject/app--<id>--directory_page), shared by the country and city pages. It reads the country’s code (and the city, empty on a country page) in the entry and lists the store locator’s stores of that country or city, rendered on the server: all of it is in the HTML. A country page sorts them by city, a city page by name. The page’s title and meta description are the entry’s.

  • Above the list: the breadcrumb (.store-list__breadcrumb, Home / store locator page / France / Lyon), shown when Show the breadcrumb on the country, city and store pages is checked in the app’s Settings; then the title (.store-list__header, .store-list__title).
  • .store-list__cities: on a country page, above the list, its city pages, the most stores first, with their number of stores, under Title of the cities, then Title of the stores; under the list, the other country pages by name, under Title of the other countries. On a city page, under the list, the country’s other city pages under Title of the other cities, then the link to its country (Link to the country), each with its number of stores.
  • Past 200 stores in the country (a number the support can change), a country page lists only the stores outside its city pages, as rows (.store-list__rows: name, linked to its page if it has one, and address) under a heading per city, without filters.
  • Structured data: a CollectionPage, the country or city (about), the brand (publisher, with the same @id as on the store pages) and the breadcrumb (BreadcrumbList), shown or not.
Setting Values Default What it does
Show the title checkbox on Off: no title, for the theme’s own Heading block above.
Title text, shown while Show the title is on empty Empty: the country’s or the city’s name.
Type filter, Services filter, Product lines filter on / off on As on the Store list.
Group by Nothing, Type Nothing A heading per type, in the order of the app’s Settings.
Card size Small, Medium, Large Medium As on the Store list.
Title of the cities text; [country] stands for the country’s name “Main cities” On a country page. Empty: no title.
Title of the stores text; [country] stands for the country’s name “All our stores” On a country page. Empty: no title.
Title of the other countries text “Other countries” On a country page. Empty: no title.
Title of the other cities text; [country] stands for the country’s name “Other cities” On a city page. Empty: no title.
Link to the country text; [country] stands for the country’s name “[country]: all our stores” On a city page, followed by the country’s number of stores.

The card content and spacing settings are the Store list’s, except Show store type and Show photos, off by default.

“Our stores by country”: a link per published country page, in columns, sorted by name in the visitor’s language (.country-directory, .country-directory__heading, .country-directory__list, .country-directory__link). With Show the cities, each country’s city pages under its name (.country-directory--cities, .country-directory__cities). On a country or city page, the current page is not a link (.country-directory__current, aria-current="page"). Nothing shows without a published country page. Settings: Title (empty, no title), Show the cities (off), Space above (48 px) and Side margin.

Two settings, shared by the three blocks, fix the display on some themes, often custom-built ones:

  • Space above: the theme’s header stays at the top of the screen and hides the top of the block (the store locator’s search, a page’s title). Set the header’s height, for example 90 px for an 86 px header. The store locator takes it into account to fill the window.
  • Side margin: the theme’s apps section has no margins, and the block goes edge to edge. Set the space to leave on each side.

The theme editor’s preview shows the result live.

The blocks have no style settings: their look comes from the theme, on purpose. To go further, an agency writes its CSS in the Custom CSS of the block’s section (500 characters) or in the theme’s CSS. The blocks’ CSS is written for that:

  • a single class is enough, without !important: each element’s base style has a single class of specificity;
  • variables for what is changed most often (spacing, radii, borders, backgrounds), to redefine on the block’s root;
  • states as attributes: aria-current on the store chosen in the store locator’s list, data-state="open" or "closed" on the opening status (store-opening-status), [hidden].

The blocks carry the usual theme classes, so that the theme styles them without any CSS of yours:

Element Classes
The h1 titles of the store locator, the store page and the country or city page h1
The store page’s main button (Get directions) button, btn
Its secondary buttons (Call, Book an appointment) button, button--secondary, button-secondary, btn, btn--secondary
The store’s presentation rte

button and button--secondary are those of Dawn and Horizon, btn and btn--secondary those of Debut and older themes. In a theme that styles none of these classes, the buttons keep an outline and some padding. That fallback style is in a CSS layer (@layer): any rule of the theme or of yours wins over it.

The store page’s main photo always fills its column, even when it grows taller than 4:3 next to a long summary.

Framed cards, on a light background, in the list and among the nearby stores:

.store-card {
--store-card-padding: 1rem;
--store-card-background: color-mix(in srgb, currentColor 4%, transparent);
border: 1px solid color-mix(in srgb, currentColor 15%, transparent);
}

The store locator’s list column on a brand background:

.store-locator {
--store-locator-panel-background: #f4efe6;
--store-locator-panel-text: #2b2118;
}

Corners are square by default, as in most themes. Square photos with rounded corners:

.store-card { --store-card-photo-ratio: 1 / 1; --store-card-radius: 12px; }
.store-page { --store-page-radius: 12px; }

The store locator’s borders, muted text and controls are computed from --store-locator-panel-text: change it with the background, keeping a 4.5:1 contrast (see Accessibility).

Classes follow BEM, prefixed by the block: store-locator__…, store-page__…, store-list__…, and store-card__… for the cards of the list and of the nearby stores. The full list is at the top of each stylesheet (store-locator.css, store-page.css, store-list.css, store-card.css), which the browser’s developer tools show.

Root Variables
.store-locator --store-locator-panel-text, --store-locator-panel-background, --store-locator-gap, --store-locator-border, --store-locator-muted, --store-locator-control-border, --store-locator-mobile-map
.store-page --store-page-gap, --store-page-border, --store-page-muted, --store-page-radius
.store-list --store-list-card-size, --store-list-gap, --store-list-group-gap, --store-list-muted
.store-card --store-card-padding, --store-card-gap, --store-card-background, --store-card-radius, --store-card-muted, --store-card-photo-ratio