Metafield filters

Metafield filters can output metafield data from a metafield object within a relevant HTML element, or as a plain string.

metafield_tag

Generates an HTML element depending on the type of metafield.

The output differs depending on the metafield type:

single_line_text_field

single_line_text_field metafields output the text inside a <span> element with an attribute of class="metafield-single_line_text_field".

multi_line_text_field

multi_line_text_field metafields output the text inside a <span> element with an attribute of class="metafield-mutli_line_text_field".

page_reference

page_reference metafields output the page title of the associated page inside an <a> element with a link to the page and an attribute of class="metafield-page_reference".

product_reference

product_reference metafields output the product title of the associated product inside an <a> element with a link to the product and an attribute of class="metafield-product_reference".

variant_reference

variant_reference metafields output the variant title of the associated product inside an <a> element with a link to the variant and an attribute of class="metafield-variant_reference".

file_reference

file_reference metafields have a different output depending on the file type:

Images

Images in the format of JPEG, PNG, and GIF output an <img> element with the following attributes:

Attribute Value