Skip to main content

Publish a Product and Feature It on a Landing Page with the LitPage CLI

Publish a product detail page and use its published ID in a ProductGrid on a landing page.

You can publish a product detail and feature it on a separate landing page. The product owns its description, photos, and specifications. A ProductGrid on the landing page links to the published product. Product Markdown support in CLI 0.6.9 is marked experimental. Try this workflow on a test site before adopting it for a catalog.

Create and review the product

npx @litpage/cli content template ./mug.md --type PRODUCT --title "Studio mug" --slug studio-mug --language EN --subdomain your-site

Keep the generated versioned schema fields. Use uploaded photo URLs for the gallery and meaningful alt text for the product images. Enter specifications that help a visitor choose a product, such as its capacity, material, or dimensions. Write a search title and description that describe that item's details.

npx @litpage/cli content validate ./mug.md
npx @litpage/cli apply ./mug.md --subdomain your-site

In Builder, verify the product title, gallery, layout, and search details. When you have reviewed the local file and draft, publish it.

npx @litpage/cli publish ./mug.md --subdomain your-site
npx @litpage/cli content list --type PRODUCT --status PUBLISHED --language EN --subdomain your-site

Open its public detail. Then locate the matching ID in the published content list. Match both slug and language before using that ID in a page. A product may have a newer authoring draft while the public page serves its previous version, so check the public detail before choosing it.

Feature the product on a landing page

npx @litpage/cli block example ProductGrid --variant basic --format yaml

Use the returned block in the page's configuration.sections. Replace the example IDs in productIds with published product IDs from the same site and language. Give the block its own stable ID and a heading that explains why the products are grouped. The selection supplies product cards from their published snapshots.

For a new landing page, follow the first landing page tutorial and use npx @litpage/cli page create --file catalog.page.yaml --out catalog-draft.page.yaml. For an existing page, start with the update workflow, retain its version pointers, and use npx @litpage/cli page save to export the new draft before publishing. Preview the page, publish its revision, then open the public page. Follow the card to the correct product detail.

The product and landing page each have their own publication history. If a card is missing, check that the product is published, then confirm the ID, site, and language in the grid.