Displaying metafields on your online store

After you add metafield definitions and assign metafield values to parts of your store, you can connect metafields to your theme to display your specialized information on your online store in a variety of ways. For example, a candle seller might want to display a burn time for candles on their product pages, while a grocery store might want to display a product expiration date for canned goods.

Other examples of specialized information that you can display on your online store include the following:

  • part numbers
  • color swatches
  • product release dates
  • featured products or variants
  • product star rating
  • files for download
  • 李成分sts

If you have anOnline Store 2.0 theme, then you can connect most metafields to your theme by using the theme editor. If you're using a vintage theme, or if you want to add metafield types that your theme doesn't support, then you canedit your theme codeor hire a Shopify Partner to help you. Learn more abouthiring a Shopify Partner.

Connecting metafields to your theme by using the theme editor

If your theme supports metafields, then you can choose how to display metafields on your online store by using thetheme editor. To find out which metafields are available in your theme, refer to your theme's documentation orcontact your theme's developer.

You can connect metafields to your theme by adding sections or blocks that supportdynamic sources. For example, theProduct infosection can support product metafields, and aCollectionsection can support collection metafields.

After you add a section or block, you can select a single metafield by clicking the connect dynamic source icon:

Connect dymamic source icon

If the connect dynamic source icon displays a+, then you can add up to 20 metafields in a single template by clicking the icon, and then selecting one metafield at a time:

Insert dymamic source icon

For step-by-step instructions, refer toUsing metafields and dynamic sources.

You can connect alistof content types toTextorRich Textsections and blocks. Product reference lists require a custom section or a third-party theme that uses product list settings.

Editing your theme code to add metafields

If you want toedit your theme codeto display metafields on your online store, then you can useLiquidto reference metafields in your page templates.

Edit your theme code only if you have coding experience. If you need help with editing your theme code, then you can hire a Shopify Partner from the Shopify Partner Directory. Learn more abouthiring a Shopify Partner.

Displaying Brand assets with metafields

You can use metafields to display yourbrand assetson your online store. Brand assets are used as a default setting, meaning after you have brand assets added, they are automatically synced with any feature that uses the Brand API.

Shopify's Online Store 2.0 themes can use your brand assets in your theme settings. You'll need to manually connect your brand assets by opening thetheme editor. Find the theme setting you want to use the brand assets on, such as the logo in your store header, and click theConnect dynamic sourcebutton.

Picture of the image select screen for logo within theme settings with the connect dynamic source button highlighted.

Click the brand asset that you want to use in your header to connect it to your theme.

The connect dynamic source panel with Default logo selected.

If the option to connect brand assets doesn't exist, then the app, channel, or theme might not be integrated with the Brand API.

Shopify准备OB欧宝娱乐APP开始销售?Try it free