Skip to product information
1 of 1
Published:2026.04.22

[Horizon] Add a product-tags block to the product card in Horizon

[Horizon] Add a product-tags block to the product card in Horizon

Applications

  • コレクション編集
View full details

A method to add a _product-tags private block that displays product tags inside the product card in Horizon. Leveraging Horizon's theme blocks architecture, it's built as a standalone block you can drop into any product card from the theme editor. For the Dawn implementation, see here.

Result

Product tags line up inside each product card. Set "excluded tags" from the theme editor to hide any tags automatically added by apps.

Product tags displayed inside product cards on a collection page

How to use

Keep your per-product tag assignments as-is, then add the "Product Tags" block inside the product card from the theme editor. List any tags you want to hide, comma-separated, in the filter field.

Tag assignment in the admin and excluded-tag setting in the theme editor

The block itself (blocks/_product-tags.liquid)

Receives the product via closest.product, runs it through the exclusion filter, then outputs a series of <span> elements. When dropped outside a product context, closest.product is empty and nothing renders — safe by design.

_product-tags.liquid — Liquid rendering

Styling via CSS Custom Properties

Theme editor setting values are piped in as CSS Custom Properties via the style attribute. A media query switches font size between mobile and desktop.

_product-tags.liquid — stylesheet

Allow the block on product cards (blocks/_product-card.liquid)

Horizon's product card uses an explicit allow-list. Add {"type": "_product-tags"} to the schema.blocks array — a single line — and the new block becomes selectable from the block picker inside product cards.

_product-card.liquid — one line added to schema blocks

Note: blocks/_product-card.liquid is a core Horizon theme file. Your edits may be overwritten when Horizon updates. After an update, reapply manually or manage the change via GitHub integration for cleaner merges.

After making a purchase (all items are ¥0), you will be able to view the sample code.

If you have already made a purchase, please login here.

Sample Codes

Test Theme :Horizon 3.4.0

blocks/_product-tags.liquid(新規作成・全体)