Breadcrumbs with metafields
Using Product Metafields with Breadcrumb Collections
Overview
The breadcrumbs section can be customized to show different parent collections for different products by using product metafields. This allows for more flexible navigation paths based on your product's specific categorization.
Setting Up the Metafield
First, create a metafield definition for your products:
Go to Settings > Custom data > Products
Click "Add definition"
Configure the metafield
Name: Breadcrumb collections
Namespace: breadcrumb_collections
Key: custom
Reference to: Collection
Add collections to individual products:
Go to any product in your admin
Scroll down to "Metafields"
Find the "Breadcrumb collections" field
Select the collections you want to appear in the breadcrumbs
Save the product
Connect the metafield
To use the metafield instead of the static collection list:
Go to your theme customizer
Add or find the Breadcrumbs section from Design Packs
Enable "Show parent collections"
Select the 'Breadcrumb collections' metafield
How It Works
The breadcrumbs will follow this logic:
If a product has collections set in its custom.breadcrumb_collections metafield, those collections will be shown
Example Use Cases
Multi-level Categories
Home > Furniture > Living Room > Sofas > Leather Sofa
Cross-Category Products
Home / Sale Items / Summer Collection / Beach Chair
Brand-specific Navigationtext
Home > Brands > Nike > Running > Air Max
Best Practices
Consistency: Maintain a consistent depth of navigation across similar products
Relevance: Choose the most relevant collections for each product
Maintenance: Regularly review and update metafields when product categorization changes
Limitations
Maximum of 10 collections can be referenced in the metafield
Collection order in the breadcrumbs will match the order in the metafield
Changes to collection handles will require updating the metafield values
Need Help?
If you need assistance setting up product metafields or customizing your breadcrumbs, please contact our support team at support@design-packs.com.
Last updated