What are Objects?
Objects in Mustache are data structures that contain information about your store, products, users, and other entities. Each object has attributes (properties) that hold specific values.Available Object Types
Quickbutik provides several types of objects you can work with:Global Objects
Available on all pages throughout your theme:Object | Description | Availability |
---|---|---|
shop | Store information and settings | All pages |
user | Current user/customer data | All pages |
basket | Shopping cart contents | All pages |
linklist | Menu and navigation data | All pages |
settings | Theme customization options | All pages |
seo | SEO meta information | All pages |
Page-Specific Objects
Available only on specific page types:Object | Description | Available On |
---|---|---|
product | Individual product data | Product pages |
category | Category and product listings | Category pages |
order | Order confirmation details | Order/Thank you pages |
blog | Blog post and article data | Blog pages |
page | Static page content | Static pages |
Object Property Access
Dot Notation for Nested Properties
Use dot notation to access nested properties:Array Index Access
Access specific array items by their index position:Working with Different Property Types
Understanding the different types of data that object properties can contain:String Properties
Number Properties
Boolean Properties
Array Properties
Object Properties (Nested Objects)
Common Object Usage Patterns
Store Information Display
Product Data Management
User Account Information
Working with Context and Parent Access
When iterating through arrays or working within sections, you may need to access parent object properties:Object Property Debugging
When working with objects, you might need to debug what properties are available:Best Practices
Check Property Existence
Always check if a property exists before using it to avoid template errors
Understand Object Hierarchy
Learn the structure of objects to access nested properties efficiently
Handle Missing Data Gracefully
Provide fallbacks for optional properties that might not always be present
Common Property Access Mistakes
Property Access Errors: These common mistakes can break your templates:
- Wrong property names:
{{product.name}}
instead of{{product.title}}
- Missing context: Forgetting
../
when accessing parent properties - Array confusion: Using
{{product.images}}
instead of iterating with{{#product.images}}
- Case sensitivity:
{{Product.title}}
instead of{{product.title}}