Wrappers and functions in Quickbutik’s Mustache implementation provide essential tools for transforming and manipulating data. These helper functions extend Mustache’s capabilities for specific use cases like image optimization, translations, and asset linking.Documentation Index
Fetch the complete documentation index at: https://quickbutik.dev/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites: This guide covers the available wrapper functions. Make sure you understand basic Mustache syntax and object access patterns first.
Key Concept: Wrappers use the
{{#function}}content{{/function}} syntax to process and transform dataAvailable Wrappers
According to the Quickbutik platform, only the following wrappers are supported:| Wrapper | Purpose | Usage |
|---|---|---|
{{#img}} | Image manipulation and optimization | {{#img}}{{product.firstimage}}_400x400{{/img}} |
{{#lang}} | Text translation via Control Panel | {{#lang}}My text here{{/lang}} |
{{#assets}} | Link to correct path for specific file | {{#assets}}css/style.css{{/assets}} |
{{#breadcrumbs}} | Output breadcrumbs/category structure | {{#breadcrumbs}} {{url}} {{title}} {{^last}} {{/last}} {{/breadcrumbs}} |
{{#asset_flags}} | Return flag icon for language | {{#asset_flags}}{{id}}{{/asset_flags}} |
Image Wrapper ({{#img}})
The image wrapper is essential for handling product images and media optimization:
Image Size Options
| Size Format | Description | Use Case |
|---|---|---|
_100x100 | Square thumbnail | Product grid thumbnails |
_300x200 | Landscape card | Product cards, lists |
_400x400 | Medium square | Product detail thumbnails |
_800x600 | Large landscape | Product detail main image |
_1200x800 | Extra large | Lightbox, zoom functionality |
Settings Home Elements Images
Language Wrapper ({{#lang}})
Handle multi-language content and translations via the Control Panel:
Navigation and UI Translation
Assets Wrapper ({{#assets}})
Link to correct paths for theme files like CSS, JavaScript, and other assets:
Breadcrumbs Wrapper ({{#breadcrumbs}})
Output breadcrumbs/category structure regardless of the current page:
Breadcrumb Properties
Within the{{#breadcrumbs}} loop:
| Property | Type | Description |
|---|---|---|
url | String | Link URL for the breadcrumb item |
title | String | Display text for the breadcrumb item |
last | Boolean | True if this is the last (current) breadcrumb item |
Asset Flags Wrapper ({{#asset_flags}})
Return flag icons for languages (used within the languages loop):
Combining Wrappers
Complete Examples with Multiple Wrappers
Best Practices
Image Optimization
Always use the
{{#img}} wrapper with appropriate dimensions for optimal performanceTranslation Consistency
Wrap all user-facing text with
{{#lang}} for proper multi-language supportAsset Management
Use
{{#assets}} for all theme files to ensure correct paths across environmentsBreadcrumb Navigation
Implement breadcrumbs for better user navigation and SEO benefits
Common Patterns
Error Handling and Fallbacks
Next Steps
Global Objects
Learn how to use wrappers with global object data
Product Pages
Apply wrappers in product page templates
Template Structure
Understand how wrappers fit into overall theme architecture
Best Practices
Follow coding standards and optimization guidelines