Product front matter reference
A product page is a markdown file in Content/Pages/products/. Everything above
the --- fence is front matter; everything below is the page body, which renders
inside the Details tab under the summary.
Three files read these keys:
| File | Reads front matter for |
|---|---|
shop.php (partial) | deciding which view to render |
ProductDetail.php | the single-product page |
ProductIndex.php | the product grid on the index page |
Nothing else. If a key isn't listed below, no view reads it.
Minimum viable product
---
title: Database Viewer
product: true
price: 500.00
currency: ZMW
store: modules-apps-store
image: img/database-viewer.png
summary: A professional read-only browser for your SQLite store databases.
payment_methods: [pawapay, bank]
---
That is enough to render a working product page with a Buy button.
Routing — which view you get
| Key | Type | What it does |
|---|---|---|
product | bool | Forces the detail view. Not needed for files already under products/ — the directory alone is enough. Use it for a product page living somewhere else. |
products_dir | string | Turns this page into the product index. Set it to the directory to list, normally products. Put it on products/index.md. |
store_page | bool | Renders the store detail view. Files under stores/ get this automatically. |
stores_dir | string | Turns this page into the store index. |
my_purchases | bool | Renders the buyer's purchase list. |
shop_dashboard | bool | Renders the seller sales dashboard. |
pawapay_dashboard | bool | Renders the PawaPay transaction dashboard. |
A page with none of these and no products_dir/stores_dir exits the shop
module early and never opens a database connection. That early exit is
deliberate — don't add shop keys to ordinary docs pages "just in case".
Order of precedence: a product page that also carries products_dir renders
as a product, not as the index.
Identity and copy
| Key | Type | Default | What it does | |
|---|---|---|---|---|
title | string | Product | The <h1>, the card title, and the fallback alt text on gallery images. | |
summary | string | — | One-line pitch. Shows on the card in the index grid, and as the first paragraph of the Details tab. | |
description | string | — | Alias for summary. Use one or the other, not both. | |
author | string | — | Shows the Author tab. Without author and author_bio, the tab is hidden entirely. | |
author_bio | string | — | Paragraph inside the Author tab. | |
details | list | — | Spec table at the bottom of the Details tab. Rows are `Label\ | Value`. |
specs | list | — | Alias for details. | |
order | int | 500 | Sort weight on the index grid only. Higher numbers come first; ties break alphabetically by title. Not used on the detail page. |
details:
[Format|Digital download, License|Single site, Updates|1 year, Support|Email]
Images
| Key | Type | Default | What it does | |
|---|---|---|---|---|
image | path | — | The card cover in the index grid. Also becomes the first slide of the detail gallery. | |
thumbnail | path | — | Alias for image. | |
image_caption | string | — | Caption for the cover slide. The images: rows carry their own caption after the pipe; image: is a bare path, so this is where its caption goes. | |
images | list | — | Extra gallery slides. Rows are path or `path\ | Caption`. |
gallery | list | — | Alias for images. | |
screenshots | list | — | Alias for images. | |
showCoverInGallery | bool | true | Set false to keep image as the card cover but leave it out of the slides. | |
gallery_include_cover | bool | true | Alias for showCoverInGallery. |
image: img/database-viewer.png
image_caption: Two-panel browser — tables left; rows right
images:
[img/dbv-tables.png|Table list with instant filter,
img/dbv-rows.png|Full-text search across every column,
img/dbv-json.png|JSON columns decoded and pretty-printed]
Behaviour worth knowing:
- Paths run through
assetUrl(), so they're relative to your asset root, same as any other image in the docs. - Duplicates are removed by path, so listing the cover again in
imagesis harmless. - Hard cap of 20 slides. Anything past that is dropped silently.
- One slide means no arrows, no counter, no thumbnail strip — but clicking it still opens the lightbox.
- Zero slides means no gallery block at all. The page renders fine.
- Images use
object-fit: contain, so nothing is cropped. Mixed aspect ratios letterbox rather than cut.
Price, tax and discount
| Key | Type | Default | What it does |
|---|---|---|---|
price | number | 0 | Base price, rounded to 2dp. 0 renders as Free and hides the quantity stepper. |
currency | string | $ | Prefixed to every formatted amount. Use the symbol or code you want printed — ZMW, K, $. Nothing converts it. |
discount | percent | 0 | Percentage off. Accepts 10, 10% or 10 %. |
allowDiscountOf | percent | — | Alias for discount. |
discount_rate | percent | — | Alias for discount. |
discountLabel | string | Discount | Text in the red badge next to the price, e.g. Early Bird Discount. |
discount_label | string | — | Alias for discountLabel. |
showOriginalPrice | bool | true | Whether the struck-through original price shows next to the discounted one. |
tax | percent | 0 | Tax rate. Drives the VAT 16% included line under the price. 0 hides the line. |
includedTax | percent | — | Alias for tax. |
tax_rate | percent | — | Alias for tax. |
taxType | string | VAT | The label in that line. VAT, GST, Sales tax. |
tax_type | string | — | Alias for taxType. |
How the numbers combine: discount comes off first, then tax is calculated on the discounted amount. Quantity multiplies the discounted unit price in the cart panel.
Two honest caveats about tax. The view displays tax as inclusive
("VAT 16% included") but computes it as an add-on, and the computed total is
never printed — the price you see is always the discounted price, tax or no tax.
The rate and type are posted to the orders endpoint, so what the invoice says is
decided server-side, not here. If you need tax to change what the buyer pays,
that's a ShopOrderStore question, not a front-matter one.
Store, payment and delivery
| Key | Type | What it does |
|---|---|---|
store | slug | Points at stores/<slug>.md. Pulls the store name, its page link, and its VAT/registration numbers into the page header and the order payload. |
payment_methods | list of ids | Filters the site-wide method list down to these. |
payments | list of ids | Alias for payment_methods. |
download | path | Enables the green Download button — but only after the buyer has paid. No download key, no button, even for a paid order. |
payment_methods filters, it does not define
Methods live in Content/Pages/products/_payments.md, site-wide, as
id|label|type|detail rows. A product's payment_methods can only narrow that
list. An id that isn't in _payments.md is silently ignored — list only
unknown ids and the cart shows "No payment method configured for this
product."
Omit the key entirely and the product offers every configured method.
Ids in use: pawapay (hosted checkout, redirects, stays pending until the
callback lands), airtel / mtn / zamtel (PIN push, marked paid on API
return), plus bank, paypal, cash, free.
The phone-number field appears automatically when the selected method id
contains airtel, mtn, zamtel, mobile or momo. There is no key for it.
Store file keys
For reference, stores/<slug>.md supplies:
title, then tax_number (or vat_number / tax_id), and
registration_number (or company_registration / reg_number).
Related products
| Key | Type | What it does |
|---|---|---|
related | list of slugs | Up to 4 products shown at the bottom. Slugs are relative to products/; the .md is optional. |
Leave related out and the module auto-fills: up to 4 other products from the
same store, in directory order. Set it explicitly when you want control over
which ones.
related: [module-uploader, master-dashboard, shop]
Keys with no reader
These appear in existing product files but no shop view reads them:
sku— carried as documentation only. If you expect it on an invoice, check whatShopOrderStoredoes with the order payload; the views don't send it.tax_country— same.taxTypeis what gets displayed and posted.
Harmless to keep. Just don't expect them to do anything on the page.
Gotchas
Commas break bracketed lists. details, images, related and
payment_methods are all split on commas before anything else. A comma inside a
caption or a label truncates it at that point. Use an em dash or semicolon:
image_caption: Two-panel browser — tables left; rows right # good
image_caption: Two-panel browser, tables left, rows right # truncated
Not every boolean is safe. showCoverInGallery and showOriginalPrice
parse false, no, off and 0 correctly. The routing flags — product,
store_page, my_purchases, shop_dashboard, pawapay_dashboard — go through
a plain cast where the string false is truthy. Don't write
product: false expecting it to switch anything off. Delete the key instead.
Path casing matters in production. Local XAMPP is case-insensitive;
Hostinger is not. img/DBV-Tables.png in front matter and dbv-tables.png on
disk works on your machine and 404s live.
Percentages are lenient, prices are not. 10%, 10 % and 10 all parse to
- But
price: K500parses to0— the currency goes incurrency, never inprice.
index. and _ prefixes are skipped. Files whose basename starts with an
underscore or with index. never appear in the product grid. That's how
_payments.md stays out of the catalogue.