Customizing Your Store Content with Metaobject
Introduction to Metaobject
- Metaobject Name: Designer
-
Metafields:
- Name
- Bio
- Social Media Links
-
Entries:
- Name: Jane Doe
- Bio: Jane Doe has designed over 100 fashion pieces.
- Social Media Links: www.jane-doe.com
|
Note: |
How to Create a Metaobject
-
Navigate to Settings > Customize data and click the Add metaobject button.
-
On the metaobject creation page, provide the basic information for the metaobject:
- Metaobject name: Identifies the metaobject (e.g., "Designer").
- Type: Defaults to the metaobject name, which is editable and serves as the namespace for its metafields.
- Description (optional): Provides additional information about the metaobject.
-
Click Add metafield to add the necessary metafields (e.g., "Name", "Bio", "Social Media Links"):
- Field name: Identifies the metafield in the SHOPLINE admin panel.
- Namespace and Key: Unique identifiers for the metafield; use namespaces to group similar metafields.
- Description (optional): Provides additional information about the metafield.
- Data Type: Specifies the type of data the metafield will store (e.g., text, document, URL). Supports single or multiple data types.
-
Click Add.
-
Return to the homepage of your SHOPLINE admin panel. From the left-hand menu, go to Content > Metaobjects, then click the metaobject you created from the list.
-
Click Add Entry to start creating entries.
-
Once an entry is added, it appears in the entry list, where you can see which store resources (products, categories, pages, and other metaobjects) reference it, making it easier to manage everything in one place.
|
Tip: After creating metaobjects, you can change their order in the metaobject list for quick access and easier management. |
Assigning Metaobject Values
-
Navigate to Settings > Customize data and select the module you want to connect.
- Click Add fields in the upper-right corner.
-
In the Data Type dropdown, select Metaobject, then choose the desired metaobject.
-
Go to the Product page and scroll to the Customize data section.
-
Use the dropdown list to assign metaobject values to the product page.
This process enables you to store custom content directly on your product page.
Displaying Metaobjects on Your Storefront (OS 3.0 Themes Only)
If you want to display metaobject content on your storefront, SHOPLINE provides two methods:
Method 1: Displaying Metaobjects via Theme Editor
Use this method to display metaobject content within existing storefront elements, such as product pages, collection pages, or custom pages.
Method 2: Publishing Metaobject Entries as Standalone Pages
You can publish individual metaobject entries as standalone pages on your storefront. No coding is required. Simply manage your metaobject content, then create and customize dedicated pages based on each entry to meet your store's unique content needs.
For example, you can create separate pages for designer profiles, brand stories, or other custom content by storing the information in metaobjects and publishing each entry as its own page.
To publish a metaobject entry as a page:
- Turn on Publish entries as pages when creating a metaobject.
-
Configure the following settings:
- Page title / Meta description: Select the metafields to use as the page title and meta description.
- Enable in Online Store: The page will only be published to your storefront when this option is selected. (Enabled by default.)
-
URL: SHOPLINE automatically generates the page URL in the following format:
https://{store-handle}.myshopline.com/pages/{metaobject-type}/{entry-handle} - Template: Select an existing template, or create a new one. You can then customize the page in the theme editor and save your changes.
- Go to Content > Metaobjects, select the desired metaobject, then add or edit entries and manage their content, such as titles and descriptions.
For detailed instructions on both methods, refer to Connecting Metaobjects in Theme Editor (OS 3.0 Themes Only).
| Note: If you turn off Publish entries as pages, all templates associated with entries under that metaobject will be disabled, and any previously published pages will be unpublished automatically. |