Container
Overview
A highly versatile content block for building everything from simple wrappers to complex callouts and link blocks, with extensive controls for styling, layout, and interactivity.
- Block name:
method/container - Category:
method-layout-blocks - Supports:
align(wide, full) - Render type: Dynamic (PHP
render_callback) - Inner blocks: Yes — accepts any blocks
Usage
The Container block is a general‑purpose wrapper that can function as a styled content card, a clickable link block, a hero unit with a background image/video, or a simple colored box. It shares much of the Section block’s background media system but adds optional link wrapping — when a link is set, the entire container renders as an <a> tag instead of a <div>.
Insert a Container, add inner content, and use the Inspector controls to configure background images, overlay shades, spacing, borders, shadows, colors, and responsive overrides. Use the block toolbar’s link control to make the entire container clickable.
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
bgVideo | string | — | Video URL for Jarallax background video |
useParallax | boolean | false | Enables parallax scrolling on the background image |
textColor | string | — | Text color value |
linkColor | string | — | Link color value (hidden when container is itself a link) |
bgColor | string | — | Background color value |
bgGradient | string | — | Background gradient value |
bgShadeColor | string | — | Shade/overlay color |
bgShadeGradient | string | — | Shade/overlay gradient |
bgImg | object | { id: "" } | Background image object with size variants |
bgSize | string | — | Background image CSS size |
bgImgAlign | string | "center center" | Background image CSS position |
link | object | — | Link object with url, opensInNewTab properties |
responsiveSettings | object | (see below) | Per‑breakpoint settings |
responsiveSettings Structure
{
"base": { "enabled": true },
"mobile": { "enabled": false, "customBg": false },
"tablet": { "enabled": false, "customBg": false },
"wide": { "enabled": false, "customBg": false }
}Control Sets
| Component | Panel | Breakpoints | Notes |
|---|---|---|---|
MethodAlignmentControls | Alignment | base, mobile, tablet, wide | alignItems only; labeled “Content Vertical Alignment” |
MethodSpacingControls | Spacing | base, mobile, tablet, wide | Padding (all 4 sides) + Margin (all 4 sides) |
MethodDimensionControls | Dimensions | base, mobile, tablet, wide | height, minHeight, mhGroup |
MethodTypographyControls | Typography | base, mobile, tablet, wide | — |
MethodBorderControls | Border | base, mobile, tablet, wide | — |
MethodShadowControl | Shadow | base only | — |
MethodBackgroundControls | Background Media | base, mobile, tablet, wide | includeVideo enabled on base |
MethodColorControls | Colors | global | When linked: textColor, bgColor, bgShadeColor. When unlinked: adds linkColor |
MethodLinkToolbar | Toolbar | — | Block toolbar link popover |
MethodResponsiveTabs | Responsive | mobile, tablet, wide | Wraps per‑breakpoint controls |
MethodStyleTag | — | — | Scoped editor <style> |
Data & Dependencies
- Jarallax: Both
jarallax.min.jsandjarallax-video.min.jsare enqueued viamethod_container_enqueue_assets. Editor initialization uses the same retry‑baseduseEffectpattern as the Section block. - Link behavior: When
link.urlis set, both editor and frontend render the block root as an<a>tag. The Color Controls panel adapts to hide thelinkColoroption (since the entire block becomes the link).
Frontend Rendering
<!-- Without link -->
<div class="method-container" id="method-{id}">
<div class="method-container-content {jarallax?}">
{jarallax-img?}
<div class="method-container-bgimg"> </div>
<div class="method-container-shade"> </div>
{inner block content}
</div>
</div>
<!-- With link -->
<a target="_self|_blank" href="{url}" class="method-container" id="method-{id}">
<!-- same inner structure -->
</a>Filters
This block does not currently expose dedicated PHP filters. Customization is handled through CSS targeting the generated #method-{id} selectors.