Skip to main content
The Tiles layout allows you to create custom patterns with items of different sizes arranged in repeating sequences. Perfect for creating unique, eye-catching gallery designs.

Overview

Tiles layout is the most flexible layout option in Visual Portfolio, allowing you to define custom patterns where items can span multiple columns and have custom heights. This creates visually interesting galleries with a curated, designer feel.

Key Features

  • Custom patterns: Define repeating tile patterns with varying sizes
  • Flexible dimensions: Items can span multiple columns and rows
  • Pattern sequences: Create complex repeating layouts
  • Masonry-based: Uses Isotope masonry mode with custom sizing
  • Responsive design: Patterns adapt to different screen sizes

Configuration Options

Tiles Type Pattern

string
default:"3|1,1|"
Defines the tile pattern. Format: columns|width,height|width,height|
  • First number: number of columns
  • Following pairs: width,height ratios for each item in the pattern
  • Pattern repeats for all items

Understanding Pattern Syntax

The tiles pattern uses a specific format:
Example: 3|1,1|2,1|
  • 3 = 3 columns total
  • 1,1 = Item 1: 1 column wide, 1x height
  • 2,1 = Item 2: 2 columns wide, 1x height
  • Pattern repeats: Items 3-4 use same pattern

Pattern Examples

Classic Alternating Pattern

Hero + Grid Pattern

Pinterest Style

Magazine Layout

Implementation Details

Pattern Parsing

The plugin parses tile patterns from the settings:

Dynamic Sizing

Items are styled dynamically based on the pattern:

Responsive Behavior

Tiles layout adapts to smaller screens by reducing columns:
  • Desktop: Full pattern as defined
  • Tablet: Reduced columns, simplified pattern
  • Mobile: Further reduced (usually 1-2 columns)

Usage Examples

Default Tiles Pattern

Hero + Grid Pattern

Pinterest-Style Pattern

Gutenberg Block

In the Block Editor:
  1. Add Visual Portfolio block
  2. Select Tiles layout
  3. Use the Tiles Selector component to design your pattern
  4. Or enter pattern manually in format: columns|w,h|w,h|
  5. Adjust gap and styling
The Gutenberg editor includes a visual Tiles Selector component that lets you design patterns with a drag-and-drop interface!

Best Practices

  • You want a unique, custom gallery design
  • Creating editorial or magazine-style layouts
  • Emphasizing certain items (hero images)
  • Building portfolio showcases with featured work
  • Creating visually interesting landing pages
  • Start simple and add complexity gradually
  • Test patterns with real content
  • Use 2-6 columns for best results
  • Create patterns that repeat well
  • Consider mobile appearance when designing
  • Complex patterns may require more calculation
  • Use lazy loading for image-heavy tiles
  • Test performance with full content
  • Optimize images to appropriate sizes
  • Ensure important content isn’t hidden on mobile
  • Use hero items (2x2) sparingly
  • Maintain readability with adequate gaps
  • Test pattern with varying image aspect ratios

Common Patterns Library

Two Column Alternating

Simple alternating with tall item

Three Column Balanced

Balanced with occasional wide item

Four Column Hero

Featured hero with grid

Five Column Magazine

Editorial magazine style

Six Column Complex

Complex pattern for large galleries

Tiles Selector Component

In Gutenberg, use the built-in Tiles Selector:
  • Located at: gutenberg/components/tiles-selector/
  • Visual drag-and-drop interface
  • Real-time pattern preview
  • Generates pattern string automatically

Common Issues

Pattern not displaying correctly: Ensure your pattern syntax is correct. Each tile should have width,height separated by comma.
Items overlapping: This can happen if widths exceed column count. Ensure the sum of widths in a row doesn’t exceed total columns.
Mobile layout broken: Complex patterns may need adjustment for mobile. Test responsive behavior thoroughly.

Combining with Features

Tiles layout works with:

Advanced Customization

Developers can hook into tiles layout:
See Custom Layouts for more details.

Masonry Layout

Dynamic heights with automatic positioning

Grid Layout

Consistent uniform grid

Source Code Reference

  • JavaScript: assets/js/layout-tiles.js:1
  • Pattern Parser: assets/js/layout-tiles.js:79
  • Layout Initialization: assets/js/layout-tiles.js:110
  • Tiles Selector: gutenberg/components/tiles-selector/
  • Isotope Fix: assets/js/layout-tiles.js:15