Shopify Development

Elevate Your Shopify Store with Custom Sections: A Kalles Theme Bento Grid Tutorial

Example of a custom bento grid layout on a Shopify store
Example of a custom bento grid layout on a Shopify store

Unlocking Advanced Design: Crafting Dynamic Bento Grid Sections for Your Shopify Store

As a Shopify migration expert at Shopping Cart Mover, we often encounter merchants who love the robust features of Shopify but crave a unique storefront that truly stands out. While premium themes like Kalles offer incredible flexibility, there comes a point when off-the-shelf sections just don't cut it. You might have a specific vision, perhaps inspired by a competitor, or you're migrating from a platform with highly customized layouts that you want to replicate.

This exact scenario recently played out in the Shopify Community forums, where a merchant using the Kalles theme, saqlain1, sought to implement a dynamic, multi-media grid section they'd seen elsewhere. The good news? With a bit of custom Liquid, CSS, and JavaScript, almost anything is possible within Shopify's flexible theme architecture. This thread perfectly illustrates how to extend your theme's capabilities and achieve truly bespoke designs.

What is a "Bento Grid" or "Showcase Grid" Section?

Before we dive into the technicalities, let's define what we're talking about. A "bento grid" or "showcase grid" is a modern, highly visual layout that breaks away from traditional linear sections. Imagine a mosaic of tiles, each capable of holding diverse content: high-resolution images, autoplaying videos, compelling headlines, descriptive text, or even key performance statistics. It's an incredibly engaging way to tell your brand story, highlight product features, or showcase testimonials in a visually appealing, non-standard arrangement.

This type of layout is particularly effective for:

  • Product Launches: Showcase different aspects of a new product line.
  • Brand Storytelling: Visually narrate your brand's journey or values.
  • Feature Highlights: Dedicate tiles to unique selling propositions.
  • Testimonials & Social Proof: Integrate customer quotes or media.

The example shared in the forum, and what we'll be dissecting, features a layout with a tall left media block, a series of stat cards, a wide right media block, and a full-width bottom banner, all within a responsive grid.

The Power of Shopify Custom Sections: Beyond Basic Blocks

Shopify's theme architecture is built around "sections" – modular, reusable components that can be added, removed, and reordered on any page via the theme customizer. While themes come with many pre-built sections, the real power lies in creating your own. This allows for:

  • Unique Branding: Differentiate your store from competitors using the same theme.
  • Enhanced User Experience: Present information in a more intuitive and engaging way.
  • Conversion Optimization: Guide customers through your content with a compelling visual flow.
  • Flexibility: Adapt your store's look and feel without being confined to theme updates.

For those looking to start their Shopify store or migrate an existing one, understanding this level of customization is key to unlocking the platform's full potential.

Implementing Your Custom Bento Grid Section: A Step-by-Step Guide

The solution provided by oscprofessional in the Shopify Community thread outlines a clear path to adding this sophisticated section. Here's how you can do it:

Step 1: Prepare Your Theme (Always Backup!)
Before making any code changes, always duplicate your live theme. This creates a safe backup, allowing you to revert if anything goes wrong. Navigate to Online Store > Themes > Actions > Duplicate.

Step 2: Create the CSS File
This file will contain all the styling for your new section, ensuring it looks great and is responsive across devices. In your duplicated theme's code editor (Online Store > Themes > Actions > Edit code), navigate to the Assets folder and click Add a new asset. Name the file section-cookware-showcase.css and paste in your CSS code (not provided in the original thread, but would typically define grid layouts, media sizing, text styles, etc.).

Step 3: Create the Liquid Section File
This is the heart of your custom section. It defines the HTML structure, incorporates Liquid logic for dynamic content, and includes the {% schema %} block which makes the section editable in the theme customizer. In your theme's code editor, go to the Sections folder and click Add a new section. Name the file cookware-showcase-section.liquid and paste the following code:

{{ 'section-cookware-showcase.css' | asset_url | stylesheet_tag }}

{%- liquid
  assign left_media_type = section.settings.left_media_type
  assign right_media_type = section.settings.right_media_type
  assign stat_blocks = section.blocks | where: 'type', 'stat'
-%}

{%- if section.settings.top_heading != blank -%}
{{ section.settings.top_heading }}
{%- endif -%}
{%- comment -%} ---------- LEFT TALL MEDIA BLOCK ---------- {%- endcomment -%}
{%- if left_media_type == 'video' and section.settings.left_video != blank -%}
{{ section.settings.left_video | video_tag: autoplay: true, loop: true, muted: true, controls: false, class: 'tc-media tc-video-el' }}
{%- elsif section.settings.left_image != blank -%}
{{ section.settings.left_image.alt | escape }}
{%- else -%}
{{ 'image' | placeholder_svg_tag: 'tc-placeholder-svg' }}
{%- endif -%} {%- if section.settings.left_show_pause_icon -%} {%- endif -%}
{%- if section.settings.left_label != blank -%}

{{ section.settings.left_label }}

{%- endif -%} {%- if section.settings.left_title != blank -%}

{{ section.settings.left_title }}

{%- endif -%}
{%- comment -%} ---------- STAT BLOCKS ---------- {%- endcomment -%}
{%- for block in stat_blocks -%}
{%- if block.settings.stat_style == 'logo_image' and block.settings.stat_image != blank -%} {%- else -%} {%- if block.settings.stat_value != blank -%}

{{ block.settings.stat_value }}

{%- endif -%} {%- endif -%} {%- if block.settings.stat_label != blank -%}

{{ block.settings.stat_label }}

{%- endif -%}
{%- endfor -%}
{%- comment -%} ---------- WIDE VIDEO/IMAGE BLOCK ---------- {%- endcomment -%}
{%- if right_media_type == 'video' and section.settings.right_video != blank -%}
{{ section.settings.right_video | video_tag: autoplay: true, loop: true, muted: true, controls: false, class: 'tc-media tc-video-el' }}
{%- elsif section.settings.right_image != blank -%}
{{ section.settings.right_image.alt | escape }}
{%- else -%}
{{ 'lifestyle-1' | placeholder_svg_tag: 'tc-placeholder-svg' }}
{%- endif -%} {%- if section.settings.right_show_pause_icon -%} {%- endif -%}
{%- comment -%} ---------- FULL WIDTH BOTTOM BANNER ---------- {%- endcomment -%}
{%- if section.settings.bottom_image != blank -%}
{{ section.settings.bottom_image.alt | escape }}
{%- else -%}
{{ 'lifestyle-2' | placeholder_svg_tag: 'tc-placeholder-svg' }}
{%- endif -%}
{%- if section.settings.bottom_eyebrow != blank -%}

{{ section.settings.bottom_eyebrow }}

{%- endif -%} {%- if section.settings.bottom_title != blank -%}

{{ section.settings.bottom_title }}

{%- endif -%} {%- if section.settings.bottom_description != blank -%}
{{ section.settings.bottom_description }}
{%- endif -%}
{% schema %} { "name": "Cookware showcase grid", "tag": "section", "class": "tc-showcase-section", "settings": [ { "type": "header", "content": "Layout" }, { "type": "range", "id": "container_width", "label": "Max content width (px)", "min": 960, "max": 1600, "step": 20, "default": 1200 }, { "type": "range", "id": "grid_gap", "label": "Grid gap (px)", "min": 0, "max": 40, "step": 2, "default": 16 }, { "type": "range", "id": "corner_radius", "label": "Corner radius (px)", "min": 0, "max": 32, "step": 2, "default": 0 }, { "type": "range", "id": "padding_top", "label": "Padding top - desktop (px)", "min": 0, "max": 120, "step": 4, "default": 60 }, { "type": "range", "id": "padding_bottom", "label": "Padding bottom - desktop (px)", "min": 0, "max": 120, "step": 4, "default": 60 }, { "type": "range", "id": "padding_top_mobile", "label": "Padding top - mobile (px)", "min": 0, "max": 80, "step": 4, "default": 32 }, { "type": "range", "id": "padding_bottom_mobile", "label": "Padding bottom - mobile (px)", "min": 0, "max": 80, "step": 4, "default": 32 }, { "type": "header", "content": "Colors" }, { "type": "color", "id": "section_bg_color", "label": "Section background", "default": "#2b2926" }, { "type": "color", "id": "card_bg_color", "label": "Stat card background", "default": "#3a3733" }, { "type": "color", "id": "text_color", "label": "Text color", "default": "#ffffff" }, { "type": "header", "content": "Top Heading" }, { "type": "richtext", "id": "top_heading", "label": "Heading", "default": "

Top Heading

" }, { "type": "header", "content": "Left Tall Media Block" }, { "type": "select", "id": "left_media_type", "label": "Media type", "options": [ { "value": "image", "label": "Image" }, { "value": "video", "label": "Video" } ], "default": "image" }, { "type": "image_picker", "id": "left_image", "label": "Image" }, { "type": "video", "id": "left_video", "label": "Video" }, { "type": "checkbox", "id": "left_show_pause_icon", "label": "Show pause icon for video", "default": true }, { "type": "text", "id": "left_label", "label": "Eyebrow label", "default": "Left Label" }, { "type": "richtext", "id": "left_title", "label": "Title", "default": "

Left Title

" }, { "type": "header", "content": "Right Wide Media Block" }, { "type": "select", "id": "right_media_type", "label": "Media type", "options": [ { "value": "image", "label": "Image" }, { "value": "video", "label": "Video" } ], "default": "image" }, { "type": "image_picker", "id": "right_image", "label": "Image" }, { "type": "video", "id": "right_video", "label": "Video" }, { "type": "checkbox", "id": "right_show_pause_icon", "label": "Show pause icon for video", "default": true }, { "type": "header", "content": "Bottom Full-Width Banner" }, { "type": "image_picker", "id": "bottom_image", "label": "Image" }, { "type": "text", "id": "bottom_eyebrow", "label": "Eyebrow label", "default": "Bottom Label" }, { "type": "richtext", "id": "bottom_title", "label": "Title", "default": "

Bottom Title

" }, { "type": "richtext", "id": "bottom_description", "label": "Description", "default": "

Bottom Description

" } ], "blocks": [ { "type": "stat", "name": "Stat card", "limit": 4, "settings": [ { "type": "select", "id": "stat_style", "label": "Content style", "options": [ { "value": "value_label", "label": "Value + Label" }, { "value": "logo_image", "label": "Logo image" } ], "default": "value_label" }, { "type": "text", "id": "stat_value", "label": "Value", "default": "100%" }, { "type": "text", "id": "stat_label", "label": "Label", "default": "Quality" }, { "type": "image_picker", "id": "stat_image", "label": "Logo image" } ] } ], "presets": [ { "name": "Cookware showcase grid", "blocks": [ { "type": "stat" }, { "type": "stat" }, { "type": "stat" } ] } ] } {% endschema %}

A quick breakdown of the Liquid file:

  • {{ 'section-cookware-showcase.css' | asset_url | stylesheet_tag }}: This line links your new CSS file, ensuring your section is styled correctly.
  • Liquid Logic ({%- liquid ... -%}, {%- if ... -%}, {%- for ... -%}): These control the flow and display of content. For example, it checks if a setting is blank before rendering content or iterates through "stat" blocks.
  • Image & Video Tags: Shopify's filters like image_url and video_tag are used to efficiently serve responsive images and videos. Note the srcset for images, which helps browsers choose the best image resolution for different screen sizes, improving performance.
  • CSS Variables (style="--tc-bg: ..."): This is a powerful technique! Instead of hardcoding colors and sizes, the section uses CSS variables defined by the section settings. This means you can change colors, padding, and more directly from the theme customizer without touching the code.
  • JavaScript for Video Controls: A small script is included to handle play/pause functionality for videos within the section, enhancing user interaction.
  • {% schema %} Block: This is crucial. It defines all the settings and blocks that will appear in your theme customizer sidebar. This allows non-developers to easily configure the section's content, images, videos, text, and even layout options like padding and corner radius, without needing to edit any code.

Step 4: Add the Section to Your Storefront

Now for the exciting part! Go to Online Store > Themes > Customize (for your duplicated theme). On any page, click Add section. Your new section will appear in the list as "Cookware showcase grid". Select it, and you can then fill in your images, videos, headings, and stat card content directly from the theme editor sidebar. No further code editing is needed after this setup!

Best Practices and Considerations for Custom Development

While custom sections offer immense power, it's important to keep these points in mind:

  • Performance: Ensure all images and videos are optimized for web. Large files can slow down your site, impacting user experience and SEO.
  • Responsiveness: Always test your custom section across various devices (mobile, tablet, desktop) to ensure it looks and functions correctly. The provided code already includes responsive image attributes and mobile padding settings.
  • Maintainability: Well-commented code makes it easier for you or another developer to understand and update the section in the future.
  • Future Theme Updates: Custom code lives within your theme. If you switch to a completely new theme, you'll need to re-implement or migrate your custom sections.
  • When to Seek Expert Help: If the thought of editing theme code is daunting, or if you have complex design requirements, don't hesitate to consult a Shopify developer or a migration expert like us at Shopping Cart Mover. We specialize in bringing intricate designs to life and ensuring a smooth transition for your e-commerce platform.

Conclusion

The ability to create custom sections like this dynamic bento grid is a testament to Shopify's flexibility as an e-commerce platform. It empowers merchants to move beyond standard templates and craft truly unique, high-converting storefronts. By understanding the basics of Liquid, CSS, and Shopify's theme architecture, you can unlock a world of design possibilities. So go ahead, experiment, and make your Shopify store truly your own!

Share:

Use cases

Explore use cases

Agencies, store owners, enterprise — find the migration path that fits.

Explore use cases