Connecting Metaobjects in Theme Editor (OS 3.0 Themes Only)
Metaobjects are store-level, reusable data records that can be connected to components on any page of your store, making them ideal for content shared across many products, such as size guides, ingredient libraries, or care instructions. Unlike product or collection metafields, Metaobjects are not tied to a specific page. You can also create dedicated template pages for a Metaobject definition and publish individual entries as standalone storefront pages with their own SEO settings.
This guide explains how to connect a Metaobject entry to a component in the OS 3.0 Theme Editor, use nested Metaobject references, apply Metaobjects across real store scenarios, create and manage Metaobject template pages, and publish a Metaobject entry as a page.
|
Notes:
|
Prerequisites for Connecting Metaobjects in OS 3.0
Before you begin:
- Your store must be running an OS 3.0 theme. Metaobject dynamic sources are an OS 3.0-exclusive feature.
- You must have created a Metaobject definition and added at least one entry in the admin panel. If you haven't done this yet, see "Customizing Your Store Content with Metaobject" before following the steps below.
Understanding Metaobjects as Store-Level Dynamic Sources
A Metaobject is a standalone, reusable data record you create and manage in your admin panel. Because Metaobjects exist at the store level, not attached to any specific product or page, you can pull their data into any component that supports dynamic sources, on any page of your store.
This makes Metaobjects especially useful for content that is shared across many products or pages, such as:
- A size guide used by an entire clothing line
- An ingredient library referenced across a beauty catalog
- A designer profile shared across all products in the same furniture collection
Connecting a Metaobject Entry to a Theme Editor Component
Once you have created your Metaobject definition and added entries in the admin panel, follow these steps to bind a Metaobject field to a component in the Theme Editor.
To connect a Metaobject:
- In the Theme Editor, click the block you want to bind (e.g., Rich text section).
- Click the Add dynamic source icon next to the content input field.
- In the dynamic source panel, select Metaobject.
- From the first list, select the Metaobject type (the definition name, e.g., "Ingredient" or "Size Chart").
- From the second list, select the specific entry you want to display (e.g., "Niacinamide" or "Women's Tops").
- From the third list, select the field whose value you want to show (e.g., "Benefits" or "Measurement Table"). Click Save to confirm the binding.
Advanced: Using Nested Metaobject References in OS 3.0
OS 3.0 supports up to two levels of Metaobject nesting. When selecting a field to display (Step 6 of "Connecting a Metaobject Entry to a Theme Editor Component" — where you choose the specific field whose value to show), if that field is itself a reference to another Metaobject, the editor lets you click into it to reach the inner object's fields.
Example: A "Product Story" Metaobject contains a "Photographer" field that references a separate "Team Member" Metaobject. You can drill in to display the photographer's name or profile image directly from the Product Story component.
| Note: A maximum of 2 levels of nesting is supported. Fields beyond the second level cannot be accessed through the Theme Editor. |
Managing Metaobject Templates and Pages
After creating your Metaobject definitions and entries, you can create dedicated templates for them and publish individual entries as standalone storefront pages. This section explains how to create and manage Metaobject templates, and how to publish Metaobject entries as pages.
| Note: A Metaobject definition must be published as a page and enabled in the Online Store before its template can be created. |
Creating a Metaobject Template Page
A Metaobject template is a page template dedicated to a single Metaobject definition, similar to how product pages use product templates. Creating one lets you design a standalone page layout for entries in that Metaobject, such as a dedicated page for each designer profile or each size guide.
To create a Metaobject template:
- In the Theme Editor, open the page selector dropdown at the top and select View all metaobjects.
- From the submenu, select the Metaobject definition you want to build a template for. This list shows every Metaobject definition created in your store.
- If the definition doesn't have a template yet, click Create a default template. SHOPLINE automatically creates a default template named after the definition's type (for example, a "Designer" definition creates a template file named designer.json).
- To create an additional template for the same definition, open the template dropdown and select + Create template. In the Create template dialog, enter a Template name (up to 25 characters) and choose which existing template to base it on from the Based on Template dropdown (defaults to Default template), then click Create. The new template is saved as {type}.{template name}.json, so you can maintain multiple layouts for the same Metaobject, such as a featured layout and a standard layout.
- Use the entry selector icon in the top toolbar (tooltip: "Jump to corresponding entry") to preview the template with different Metaobject entries, similar to how you preview a product template with different products.
|
Notes:
|
Publishing a Metaobject Entry as a Storefront Page
Once you've created a Metaobject template, you can publish an individual entry from that Metaobject definition as a standalone page on your storefront, complete with its own SEO settings and URL.
To publish a Metaobject entry as a page:
- In your admin panel, open the Metaobject entry you want to publish.
- Turn on the option to Publish entries as web pages.
- Set the page's SEO title and meta description using the SEO section, the same component used for other page types.
- Choose the URL for the page. By default, published Metaobject pages use the path /pages/{type}/{entry handle}.
- Select which Metaobject template to use for the page from the template dropdown. If the definition doesn't have a template yet, create one in the Theme Editor first (see "Creating a Metaobject Template Page" above).
| Note: The default URL format for published Metaobject pages is /pages/{type}/{handle}. Although this path starts with /pages/, it's a Metaobject page, not a custom page — the two are managed and edited separately. |
Editing and Removing Metaobject Templates
You edit a Metaobject template the same way as any other page template — add, remove, and configure sections and blocks directly in the Theme Editor.
| Important: Metaobject templates can't be deleted from within the Theme Editor. To remove a template, delete its file using the Code Editor: go to your SHOPLINE admin panel > Online Store > Design, click the three-dot icon in the My theme section, then select Edit code. |
Real-World Use Cases for Metaobjects
The following examples show how different store types use Metaobjects to keep content consistent without repeated manual updates.
Fashion: Shared Size Guide
A clothing store creates a "Size Chart" Metaobject with fields for Category, Image, and Measurement Table. Multiple products share the same size chart entry. When the measurements change, the store updates the entry once, and the change reflects on every product page automatically.
Health & Beauty: Ingredient Library
A skincare brand creates an "Ingredient" Metaobject with fields for Ingredient Name, Benefits, Description, and Scientific Reference. Entries include Niacinamide, Hyaluronic Acid, and Retinol. Each product page connects to the relevant entries to display a structured Key Ingredients section, sourced from one central library.
Furniture: Designer Collection
A furniture retailer creates a "Designer" Metaobject with fields for Designer Name, Portrait, Bio, and Design Philosophy. Entries include designers such as Thomas Berg and Clara Voss. Multiple products in each designer's collection reference the same entry, so when a designer updates their bio or a new portrait photo is added, the change reflects instantly across every product page in that collection.
| Tip: Metaobjects are also ideal for merchants migrating from other platforms who have existing custom data structures they want to carry over. |
Frequently Asked Questions about Metaobjects
Q 1 Can I use Metaobjects on pages other than product pages?
Yes. Because Metaobjects are store-level sources, you can connect them to components on any page, homepages, custom pages, collection pages, and more.
Q 2 What is the difference between a metafield and a Metaobject?
A metafield is a custom attribute attached directly to a resource such as a product or collection. A Metaobject is a standalone, reusable data record that can be referenced across multiple products, pages, or components. Use metafields for product-specific data and Metaobjects for shared content libraries. For more on metafields and dynamic source dimensions, see "Configuring Dynamic Sources (Metafields) in OS 3.0 Theme Editor."
Q 3 How do I create a Metaobject definition and add entries?
Metaobject creation and management is covered in "Customizing Your Store Content with Metaobject." Complete that setup first, then return to this guide to connect entries to your storefront.
Q 4 Can I delete a Metaobject template from the Theme Editor?
No. Metaobject templates can't be removed directly in the Theme Editor. To delete one, remove its file using the Code Editor.
Q 5 What happens if I try to create a Metaobject template before adding any entries?
You'll see a message letting you know the template can't be edited yet. Add at least one entry to the Metaobject definition in your admin panel, then return to the Theme Editor to create and edit the template.
Q 6 Will creating a Metaobject template affect my ability to update my theme?
No. Creating a Metaobject template uses standard Theme Editor functionality, so it doesn't turn your theme into a customized version and won't affect your ability to receive automatic theme updates.