Skip to content

Metafields

<show-metafield key="…"> reads a product metafield (namespace defaults to custom; override with namespace="…"). It requires a <storesynk-product> ancestor (SSK-102) - outside it there’s no product to read from. When the metafield is missing or blank it sets [ss-empty] and clears itself by design; hide it with show-metafield[ss-empty] { display: none }. Confirm the key/namespace exactly match a metafield defined on the product (the query only fetches identifiers present in the DOM).

The “Care:” style label shows even when the metafield is empty

Section titled “The “Care:” style label shows even when the metafield is empty”

Wrap the label and the <show-metafield> in a <metafield-wrapper>: it sets [ss-empty] on itself when none of its descendant show-metafield elements resolve, so the whole block hides (metafield-wrapper[ss-empty] { display: none }). A bare show-metafield only hides itself, leaving a stray label behind.

A list metafield renders only one value (or nothing)

Section titled “A list metafield renders only one value (or nothing)”

For a list.* metafield, show-metafield clones a nested <metafield-item> template once per value. Author exactly one <metafield-item> inside the show-metafield (it must sit inside one - SSK-108); with none, a list metafield has nothing to clone. Scalar (non-list) metafields don’t need metafield-item.


Imported from the Storesynk skill v0.1.0 (references/known-issues.md). To change this page, change it there.