Back icon

Back to all posts

Accentuate | Digital Commerce

Sposoby wyświetlania Metaobiektów

Discover effective ways to display Metaobjects on your Shopify store using Liquid code, the Theme Editor, and Metaobject templates for improved data management and user experience.

2 minutes, 30 seconds

A brief introduction to Metaobjects

Metaobjects are a powerful feature in Accentuate Custom Fields designed to improve the efficiency of managing your Shopify store. Think of them as containers of multiple new Metafields that you can apply anywhere in your store as many times as you want.

When you are done with creating your Metaobject, you will want to display it on your storefront. We will explain a few ways this can be done easily. 

Displaying Metaobjects

Here are three simple methods to display Metaobjects:

  • Using Liquid Code

This method offers precise control over how your data is displayed.

Liquid code allows you to integrate Metaobjects directly into your theme. Accentuate generates Liquid code for all your field definitions, which you can copy and use like this.

Just pay attention that in order to to access Metaobjects data, you'll need the metaobject definition type, instance handle, and field key. So, the path to access this data should look something like this:

{{ shop.metaobjects.definition_type.instance_handle.field_key }}

  • Using the Theme Editor

The Theme Editor is user-friendly and doesn’t require coding skills. Yaay! 

It's easy, just create Metaobject references and connect them to dynamic blocks in your theme. This allows you to manage and display Metaobjects easily through a graphical interface, making it ideal if you prefer a visual approach.

You will need to follow 3 simple steps:

  • Create a reference to the metaobject you want to use
  • Add a value to the reference
  • Connect a block on your storefront to the metaobject you are referencing

If you have not already done so you need to create a theme block that supports dynamic sources. Then you simply click the database icon in the top right and find the metaobject reference, and select the field you want to use in that block.

  • Using Metaobject Templates

Ideal for content-rich pages, enabling the creation of full web pages from Metaobject data.

Metaobject templates are perfect for creating content-rich pages. They allow you to build entire web pages from Metaobject data. This method is particularly useful for displaying complex data structures, such as detailed product information or custom content sections.

If you choose this method, make sure that the metaobject you have set up has “Publish entries as web pages” enabled.

Next, you need to create a theme template to display your Metaobjects data using the theme editor. Setting up a simple template takes just a few minutes. Once it's ready, each new active Metaobject will function as a webpage your users can visit. Be sure to include call-to-action buttons and reference products on these pages to drive more sales.

Conclusion

Metaobjects provide flexible options for displaying data on your Shopify store. Whether you prefer the precision of Liquid code, the ease of the Theme Editor, or the comprehensive capabilities of Metaobject templates, there’s a method to suit your needs. For more detailed guidance, visit the Accentuate Custom Fields Help Center.

By using these methods, you can efficiently manage and display complex data, improving the functionality and user experience of your Shopify store.

Read More