Overview
Smart Collections templates enable customization of layout and functionality beyond the admin settings. The component is built with Vue.js, supporting Vue.js attributes for conditional rendering and dynamic behavior.
Overview¶
Custom templates let you:
- Override the default Smart Collections layout
- Add custom filtering UI
- Customize product card display
- Implement unique sorting interfaces
- Integrate with theme-specific styling
Available Templates¶
| Template | Best For |
|---|---|
| Dropdown Template | Compact filter UI above product grid |
| Sidebar Template | Desktop-focused with persistent filter sidebar |
Vue.js Integration¶
Templates support all Vue.js directives:
<!-- Conditional rendering -->
<div v-if="shouldShowHeroImage()">
<img :src="getCollectionHeroImage()" />
</div>
<!-- Loops -->
<div v-for="product in products" :key="product.id">
{{ product.name }}
</div>
<!-- Event handling -->
<button @click="addToCart(product)">Add to Cart</button>
Any globally accessible function can be used to provide alternate user experiences.
Related¶
--- title: Custom Templates excerpt: Customize Smart Collections layout and functionality with Vue.js templates --- Smart Collections templates enable customization of layout and functionality beyond the admin settings. The component is built with Vue.js, supporting Vue.js attributes for conditional rendering and dynamic behavior. ## Overview Custom templates let you: - Override the default Smart Collections layout - Add custom filtering UI - Customize product card display - Implement unique sorting interfaces - Integrate with theme-specific styling ## Available Templates | Template | Best For | |----------|----------| | [Dropdown Template](./smart-collections-dropdown-template.md) | Compact filter UI above product grid | | [Sidebar Template](./smart-collections-sidebar-template.md) | Desktop-focused with persistent filter sidebar | ## Vue.js Integration Templates support all Vue.js directives: ```html <!-- Conditional rendering --> <div v-if="shouldShowHeroImage()"> <img :src="getCollectionHeroImage()" /> </div> <!-- Loops --> <div v-for="product in products" :key="product.id"> {{ product.name }} </div> <!-- Event handling --> <button @click="addToCart(product)">Add to Cart</button> ``` Any globally accessible function can be used to provide alternate user experiences. ## Related - [Dropdown Template](./smart-collections-dropdown-template.md) - [Sidebar Template](./smart-collections-sidebar-template.md) - [Smart Collections Overview](./smart-collections.md) - [Event Listeners](./smart-collections-event-listeners.md)
See something that needs updating?
Suggest an edit