Omnira Docs v1.0.0

Section reference › Pricing & commerce

Product grid "type": "products"

Shop product cards with photo, category, name, rating and price, and a second photo on hover. Use it for featured products, new arrivals, related items or a full shop page.

Example of the products section
The example below, rendered with placeholder images.

Example#

Paste this into the sections list of a page file:

JSON
{
  "type": "products",
  "tone": "alt",
  "eyebrow": "New arrivals",
  "title": "Fresh for the season",
  "columns": 4,
  "items": [
    {
      "name": "Linen overshirt",
      "category": "Men",
      "price": 89,
      "image": "placeholder",
      "image2": "placeholder",
      "rating": 4.8,
      "badge": "New",
      "link": "#"
    },
    {
      "name": "Merino crew sweater",
      "category": "Women",
      "price": 120,
      "oldPrice": 150,
      "image": "placeholder",
      "rating": 4.9,
      "badge": "Sale",
      "link": "#"
    },
    {
      "name": "Leather weekend bag",
      "category": "Accessories",
      "price": 245,
      "image": "placeholder",
      "rating": 5,
      "link": "#"
    },
    {
      "name": "Organic cotton tee",
      "category": "Men",
      "price": 34,
      "image": "placeholder",
      "rating": 4.6,
      "link": "#"
    }
  ],
  "buttons": [
    {
      "label": "Shop all products",
      "href": "shop.html",
      "style": "outline"
    }
  ]
}

Options#

OptionTypeDefaultDescription
eyebrowstring—Small label shown above the title.
titlestring (HTML allowed)—Section heading. You can use <em> or <br> inside it.
textstring—Short intro paragraph under the title.
headAlignstringcenterAlignment of the eyebrow/title/text block. "start" puts it on the left.
Values: center | start
itemsarray | {"$data": "products"}—The products. Write them out, or in a multi-page demo pull them from data.json.
columnsnumber4Cards per row on large screens.
Values: 2 | 3 | 4 | 6
buttonsarray—Buttons shown centred below the section. See the "buttons" fields.

Also accepts the options every section accepts: id, tone, padding, fluid, class, hidden.

Fields of each entry in items#

OptionTypeDefaultDescription
namestring—Product name (links to "link").
imagestring—Product photo.
image2string—Second photo, shown when the visitor hovers over the card (optional).
categorystring—Small label above the name.
pricenumber | string—A number gets the demo currency (e.g. 48 becomes $48, 12.5 becomes $12.50). A string is shown as written.
oldPricenumber | string—Previous price, shown crossed out.
badgestring—Label on the photo, e.g. "New" or "Sale".
ratingnumber—Star rating out of 5.
linkstring—Product page address. "href" also works; records with their own page get it automatically.

Fields of each entry in buttons#

OptionTypeDefaultDescription
labelstring—Button text. A button without a label is not shown.
hrefstring—Link address, e.g. "contact.html" or "#pricing". Default "#".
stylestring—primary (default) | outline | light | dark | accent | link. "link" is a text link with an arrow.
iconstring—Bootstrap Icons name shown after the label, without "bi-" (e.g. "arrow-right").
videostring—A YouTube/Vimeo embed URL. The button then opens the video in a pop-up instead of following href.

Tips#

  • Use 4, 8 or 12 products with 4 columns (3, 6 or 9 with 3 columns) so the rows are full.
  • The currency symbol for number prices comes from "currency" in the demo settings (demo.json).
  • On a product page, show related items with "items": {"$data": "products", "exclude": "@item", "limit": 4}.
  • The heart, eye and "Add to cart" buttons on the cards are for show only; they do not store anything.

Editing it in the HTML files#

Each card is a .product. The name and link are in h3.product-name a, the price in .product-price span and the crossed-out price in .product-price del.

Where it's used#

Open these pages in template/ to see it working:

  • Coffee Shop: template/cafe/index.html (source src/demos/cafe/pages/index.json)
  • Gym & Fitness: template/gym/cart.html (source src/demos/gym/pages/cart.json)
  • Car Dealer: template/car-dealer/parts.html (source src/demos/car-dealer/pages/parts.json)
  • Interior Design: template/interior-design/cart.html (source src/demos/interior-design/pages/cart.json)
  • Fashion Store: template/fashion-store/404.html (source src/demos/fashion-store/pages/404.json)