Home
Wiki
Home
Wiki
  1. 1. Structure
  • Back to home
  • 1. Themes
  • Vs Code
    • Getting Started
  • Kitchenware
    • Layout
      • New Layout
      • Legacy Layout
    • Components
      • Announcement
      • Banner Carousel
      • Banner With Products Carousel
      • Blog Category List
      • Blog List
      • Brand List
      • Brands Carousel
      • Breadcrumb
      • Call To Action
      • Cart
      • Categories List
      • Change Password
      • Checkout
      • Cookie Manager
      • Filter list
      • Footer
      • Forgot Password
      • Form
      • Hero Carousel
      • Icon Block
      • Invitation
      • Last Visited Products
      • Layout
      • Login
      • Map
      • Nav Bar
      • Offer
      • Product Attachments
      • Product Attributes
      • Product Documentation
      • Product Expected
      • Product Modal
      • Products Block
      • Products Carousel
      • Product Single
      • Profile
      • Quote
      • Register
      • Related Products
      • Search
      • Stores
      • Subscribe Newsletter
      • Text with Image
      • Top Bar
      • Video
    • Reusables
      • Getting Started
    • Assets
      • Getting Started
    • SDK
      • Products
        • _findProductsByCategory
        • _findProductsByIds
        • _findProductsByTitle
        • _findProductsByFilter
        • _findProductsByCriteria
        • _findProductsAndCalculate
        • _findProductsThenCalculate
        • _getProductAttributeSet
        • _setLastVisited
      • Categories
        • _findCategoryTreeById
        • _findCategoriesByIds
        • _findCategoryByAlias
        • _findCategoryTreeByAlias
        • _getCategoryContent
      • Collections
        • _getCollectionContent
        • _findCollectionsByIds
        • _findCollectionsByIdsThenCalculate
      • Brands
        • _getBrandContent
        • _findBrandsByIds
      • Cart
        • _addToCartMulti
        • _addToCart
        • _setCart
        • _clearCart
        • _setCartListener
        • _removeFromCart
        • _calculateCart
      • Checkout
        • _startCheckout
        • _updateCheckout
        • _completeCheckout
      • Shopping Lists
        • _getShoppingLists
        • _updateShoppingList
        • _createShoppingList
        • _deleteShoppingList
        • _getShoppingListByAlias
      • Navigation
        • _getFooterMenu
        • _getHeaderMenu
      • Users
        • _getUserById
      • Utils
        • _calculateCurrency
        • _getCurrencySymbol
        • _getCulture
        • _subscribeToNewsletter
        • _findUnitsByIds
  • Noir
    • 0. Introduction
    • 6. FAQ
    • 1. Structure
      • _Overview
      • LayoutA.liquid
      • ComponentsList.liquid
      • Metas.liquid
      • CssVariables.liquid
      • Json.liquid
      • GoogleTagManager.liquid
      • StagingButton.liquid
    • 2. Components
      • _Overview
      • Announcement
      • BannerCarousel
      • BlogCategoryList
      • BlogHighlights
      • BlogList
      • BrandList
      • Breadcrumb
      • Cart
      • CategoriesList
      • ChangePassword
      • Checkout
      • CookieManager
      • CustomTable
      • Faq
      • FilterList
      • Footer
      • ForgotPassword
      • Form
      • IconBlock
      • Invitation
      • LastVisitedProducts
      • Login
      • Map
      • NavBar
      • Offer
      • ProductAttachments
      • ProductAttributes
      • ProductComparison
      • ProductDocumentation
      • ProductMixList
      • ProductsBlock
      • ProductsCarousel
      • ProductSingle
      • Profile
      • Quote
      • Register
      • RelatedProducts
      • SingleBlog
      • Stores
      • TextWithImage
      • ThankYouPage
      • TopBar
      • Wishlist
      • OrderReviews
      • ProductReviews
      • Newsletter
    • 3. Reusables
      • _Overview
      • Addresses
      • AddressForm
      • AnnouncementModal
      • BackToTop
      • BillingRetail
      • BlogPostingStructuredData
      • BrandListStructuredData
      • CollectionStructuredData
      • Company
      • General
      • GroupChildrenTable
      • Login
      • LoginModal
      • MonthlyTransactions
      • Offers
      • Orders
      • Payment
      • ProductAttachments
      • ProductAttributes
      • ProductAvailabilityAction
      • ProductComparisonButton
      • ProductComparisonFloatingButton
      • ProductGridItem
      • ProductGridItemClassic
      • ProductListItem
      • ProductModal
      • ProductStructuredData
      • ProfileInfo
      • PromptModal
      • Quotes
      • Register
      • Services
      • Shipping
      • ShoppingLists
      • ShoppingListsButton
      • ShoppingListsNavbar
      • StoresStructuredData
      • Toast
      • Transactions
      • Users
      • VariantContent
      • VariantContentClassic
      • WishlistButton
      • ProductRating
      • ClientHelpers
      • FaqStructuredData
      • ShoppingAssistant
    • 4. Assets
      • Fonts
      • Images
      • Templates
      • Javascript
        • _Overview
        • theme.js
      • Css - Scss
        • _Overview
        • ThemeClasses
    • 5. SDK
      • _Overview
      • LiquidGlobals
      • ServicesSDK
  1. 1. Structure

LayoutA.liquid

Purpose#

LayoutA.liquid is the main layout template of Noir.
It renders the global HTML skeleton and composes the page using:
Header component list
Body component list
Footer component list
It also loads the theme's CSS/JS and injects runtime globals used by client-side code.

Where it's used#

This layout is the entry point for page rendering in Noir.
All pages that use Layout A will pass through this template.

High-level structure#

Page identity#

The layout relies on a server-provided Root.Page.Identity.* object for page-level decisions:
RendersOwnPageTitle — when true, the layout hides its own H1 (the page renders its title itself).
BodyClass — the page-level class added to <body>.
Template — emitted as data-template on <body>.
Handle — emitted as data-handle on <body>.

HTML & language mode#

Sets <html lang="..."> using Root.Page.Metas.IsoLang
Adds the dark class only when both conditions are true:
Root.GlobalData.Settings.ShowDarkMode is enabled (settings gate), and
Root.Page.Data.Darkmode is enabled (per-page flag)

Head includes#

In <head>, the layout renders shared infrastructure includes:
Structure\Metas
Structure\CssVariables (rendered with GlobalData.Settings as Settings)
Structure\GoogleTagManager
It also loads core styles:
vendor CSS (swiper, lightgallery, nouislider, flatpickr)
theme CSS bundle: output.css
optional custom CSS: GlobalData.Settings.CustomCss
Fonts
Preloads the Ubuntu font family (woff2) and the icon font (icons.woff).
reCAPTCHA
Does not load the standard recaptcha/api.js globally. The Form component injects it on demand, only on pages where a form shows the captcha.
Conditionally loads reCAPTCHA Enterprise based on GlobalData.Settings.Captcha (only when at least one captcha action is enabled). The script variant depends on Captcha.GoogleRecaptchaEnterprise.KeyRequiresChallenge.
Asset paths and versioning
Asset base path is GlobalData.RootPath
Cache busting uses GlobalData.Settings.Version
Newsletter provider scripts
HeaderComponents, BodyComponents and FooterComponents hold only the components placed on the current page. The layout loops over all three, and for every NoirNewsletter component collects its HeadScripts and BodyScripts.
Each distinct script block is emitted once, even when several newsletters use the same provider. HeadScripts are output just before </head>, and BodyScripts just before </body>.
Pages without a newsletter load nothing. See the Newsletter component page for the model fields.

Page composition (Header / Body / Footer)#

Header#

{% render 'Structure\\ComponentsList' with HeaderComponents as components %}

Main section (#app)#

Inside <main id="app">, Noir renders:
A Skip to content accessibility link (targets #app)
Toast reusable: Reusables\Toast\Default
Breadcrumb component: Components\Breadcrumb\Default
Page title block (H1, shown/hidden based on the page flag and breadcrumb depth)
Body component list
{% render 'Structure\\ComponentsList' with BodyComponents as components %}

Body class#

The layout builds the <body> class list from server-provided values:
Root.Page.Identity.BodyClass — page-level class provided by the platform (used for styling/targeting without hardcoding routes).
{{GlobalCssClass}} — platform-provided extra global CSS class.
It also sets data attributes for targeting:
data-template="{{ Root.Page.Identity.Template }}"
data-handle="{{ Root.Page.Identity.Handle }}"
Additional body classes:
handheld-toolbar-enabled — enables layout behavior for the mobile toolbar.
plain-page — added only when the page title block is visible (i.e. when hide_div == false; see H1 visibility rules below).

H1 / page title block#

The layout includes an H1 in a .page-title wrapper:
<div class="page-title{% if hide_div %} sr-only{% endif %}" {% if hide_div %} tabindex="-1"{% endif %}>
    <div class="container">
        <h1 class="-mb-6 lg:-mb-20">{{ Page.metas.title }}</h1>
    </div>
</div>
Visibility rules (the hide_div flag):
The title block is visually hidden (sr-only) when Root.Page.Identity.RendersOwnPageTitle is true (the page renders its own title, e.g. cart/checkout/product/category).
It is also hidden when Root.Page.Breadcrumbs.size > 2 (deeper navigation paths where the breadcrumb already provides context).
When the title block is visible (hide_div == false), the layout adds plain-page on the <body>.

Breadcrumbs#

The breadcrumb UI is always rendered from the layout:
{% render 'Components\\Breadcrumb\\Default' %}
Notes:
Breadcrumb data comes from Root.Page.Breadcrumbs.
Breadcrumb depth is also used by the layout to decide whether the H1/title block should be shown.

Footer#

The footer is rendered after </main> and is composed via the footer component list.
{% render 'Structure\\ComponentsList' with FooterComponents as components %}

Global UI / Modals outside main#

After <main>, the layout renders shared UI that should exist on all pages:
Reusables\BackToTop\Default
Reusables\ShoppingAssistant\Default for authenticated shoppers only; its launcher also waits for a successful assistant-availability check.
Reusables\ProductComparisonFloatingButton\Default
Modals:
Reusables\PromptModal\Default
Reusables\ProductModal\Default
Reusables\LoginModal\Default

Debugging helpers#

Near the end of the body, the layout includes:
Structure\\StagingButton (staging/dev helper)
When the environment is staging, Structure\\StagingButton renders Structure\\Json to log a serialized view model in DevTools.
This is very useful when validating component model contracts.

Script loading order (very important)#

The layout loads scripts using defer to ensure predictable execution after parsing.
Scripts include:
Vendor libraries: axios, swiper, lightgallery, nouislider, flatpickr
/Themes/Noir/componentscripts.js
/Themes/Noir/Assets/js/theme.js
Alpine.js

Why this matters#

componentscripts.js typically registers component/reusable JS objects.
theme.js contains shared utilities and Alpine stores used across components.
Alpine runs after the above are available.

Runtime globals injected into window#

LayoutA.liquid defines configuration flags used by client-side behavior:
window.checkoutConfig
showBilling
showShipping
showPayment
window.translations (example keys used by UI, e.g. Shopping Lists)
window.showProductComparison
window.showShoppingLists
window.showWishlist
window.userAuthenticated
window.userId
window.showDarkMode
These values are referenced by Assets/js/theme.js and various components/reusables.

Recommendations#

Page title visibility: title block visibility depends on page type and breadcrumb size.
Global UI: modals/toast exist on every page by design; avoid duplicating them inside components.
Versioning: always keep version query params for asset updates to propagate correctly in cached environments.
Modified at 2026-11-25 09:46:18
Previous
_Overview
Next
ComponentsList.liquid
Built with