Display merchant-defined product metafields. show-metafield resolves one metafield by
key (or its field alias) + namespace (default custom) and renders it by type;
metafield-wrapper hides a whole label+value block when its metafields are absent;
metafield-item is the per-value template a list.* metafield clones. The metafield
identifiers are collected from the DOM and fetched via the PRODUCT_METAFIELDS query, then
held on productContext.metafields.
show-metafield
Section titled “show-metafield”- Purpose: metafield displayer. Renders by type - scalars as text;
url/linkonto a nested<a>; money/dimension/weight formatted;rich_text_fieldas HTML;file_referenceas<img>/<video>/download link; andlist.*types by cloning a nestedmetafield-itemper value. ExtendsLightElement. - Attributes:
key : string = ""- the metafield key (required to resolve anything, unlessfieldis given).field : string = ""- an alias forkey; when both are set,fieldwins. It exists because React/JSX silently swallows akeyprop (React’s reserved list key), so in@storesynk/next/ any React JSX you must authorfield=, neverkey=. In plain HTML (no-build sites, Astro.astrotemplates) either works -key=is the conventional spelling there. Read identically by the client element, the SSR transform, andcollectMetafieldIdentifiers.namespace : string = "custom"- the metafield namespace.
- Required ancestor / context:
storesynk-product(consumesproductContext). - Children / template rule: for a
list.*metafield, exactly onemetafield-itemtemplate (cloned per value). Scalar metafields need no children. No SSK-107 - a scalar renders without a template. - Events: none.
- State it sets:
[ss-empty](and clears itself) when the metafield is missing or blank - hide withshow-metafield[ss-empty] { display:none }.
metafield-wrapper
Section titled “metafield-wrapper”- Purpose: groups a metafield displayer with its label and hides the whole block when none
of its descendant
show-metafieldelements resolve to a value (so a “Care:” label never shows for a product lacking the metafield). ExtendsLightElement. - Attributes: none.
- Required ancestor / context:
storesynk-product(consumesproductContext). - Children: a label + one or more
show-metafield. - Events: none.
- State it sets:
[ss-empty]on itself when no descendantshow-metafieldhas a value - hide withmetafield-wrapper[ss-empty] { display:none }.
metafield-item
Section titled “metafield-item”- Purpose: the per-value template a
list.*metafield clones (one clone per list value). A logic-free styleable element - no logic of its own. - Attributes: none.
- Required ancestor / context:
show-metafield(SSK-108). - Children: whatever markup should repeat per value; the engine writes each value into the
clone (text, or an
<a>/<img>for link/file types). - Events / state: none.
Imported from the Storesynk skill v0.1.0 (references/component-reference.md). To change this page, change it there.