Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

Block definitions

How a block type is defined in explayouts.ini (Name, Handler, ViewTypes, IsContainer, Placeholders, HasCollection, Category), the shipped blocks by category, and adding a view type or a new block to a design.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/designers/theme-design/block-definitions.md

On this page

Block definitions

This page is for designers who want to know which blocks editors can place and how to add looks to them. Every block type is a [BlockDefinition_<identifier>] section of extension/explayouts/settings/explayouts.ini.append.php.

Contents

  1. Anatomy of a definition
  2. The shipped blocks
  3. Adding a view type: no PHP
  4. Adding a block type

Anatomy of a definition

[BlockDefinition_list]
Name=List
Handler=expLayoutsListBlockHandler
ViewTypes[]=list
ViewTypes[]=grid
ViewTypes[]=list_numbered
ViewTypes[]=list_zigzag
ViewTypes[]=list_accordion
ViewTypes[]=grid_featured
HasCollection=1
Category=listing
KeyMeaning
Namethe label editors see
Handlerthe PHP class that defines the block's parameters and data
ViewTypes[]the shapes the block can render in; editors pick one
IsContainer=1 + Placeholders[]the block holds other blocks in named places (two_columns has left and right)
HasCollection=1the block shows content from a collection (picked items or a query)
Categorythe group in the editor's block list: basic, containers, listing, gallery, components, placeholders

[BlockSettings] AvailableBlocks[] lists the blocks editors may add.

The shipped blocks

CategoryBlocks
basictitle, text, html, rich_text, image, button, spacer, divider, markdown, video, map, alert, badge, progress ...
containerscolumn, two_columns, three_columns, four_columns
listinglist, grid, list_zigzag, list_accordion, single (and others)
gallerygallery, slider, thumb_gallery, grid_gallery, carousel, sushi_bar
componentshero, about, features, logos, quote, lead and the exp_component_* blocks
placeholderstpl_block (a template part of the page), full_view (the page's own content)
Layouts, Components: the layout types, zones and block definitions the installation offers
Layouts, Components: the layout types, zones and block definitions the installation offers

The exact list and categories are in the INI file; doc/eng-us/bc/6.0/LAYOUTS.md has a block catalogue with parameters.

Adding a view type: no PHP

The cheapest way to give editors a new look: add a view type to an existing block and write its template. In your design extension's settings/explayouts.ini.append.php:

[BlockDefinition_list]
ViewTypes[]=mytheme_cards

then let the block template draw it. The shipped block/list.tpl has one markup; the media design's block/list.tpl dispatches by view type to block/list/<view_type>.tpl, which is the pattern to follow:

{* design/mytheme/templates/explayouts/block/list.tpl *}
{def $vt = first_set( $block.view_type, 'list' )}
{include uri=concat( 'design:explayouts/block/list/', $vt, '.tpl' ) block=$block}
{undef $vt}

and design/mytheme/templates/explayouts/block/list/mytheme_cards.tpl. See Block view templates.

Adding a block type

A new block type needs a handler class (PHP), so it is a developer's task: register it with Name, Handler, ViewTypes[] (and HasCollection=1 for content), add a template per view type under block/, regenerate autoloads and clear caches (doc/eng-us/bc/6.0/LAYOUTS.md, "Extending the system"). A container rarely needs its own handler: expLayoutsContainerBlockHandler with IsContainer=1 and Placeholders[] is enough.

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x