Humblee

A humble PHP framework & CMS

Block Types

A block type is a named, reusable content slot. It defines what kind of content an editor can enter — plain text, rich text (WYSIWYG), Markdown, or a custom structured form — and gives that slot a stable identifier used in both PHP and the CMS.

Block types are managed in Admin > Blocks.


Creating a block type

Each block type has two essential fields:

Label — the human-readable name shown in the admin interface. For example: Body Copy, Page Title, Intro Text.

Object key — a lowercase, underscore-separated identifier used in your PHP view to reference this block. For example: pagebody, page_title, intro_text. Once a block has been used on a live page, changing its object key will break any view that references the old key and orphan the content rows in the database. Treat it as immutable.

Input type — the editing interface and storage format for this block's content:

Type Description
Plain text Single-line or multi-line raw text
Rich text WYSIWYG HTML editor
Markdown Plain text that is automatically converted to HTML by Parsedown on output
Custom A structured form you define — used for blocks with multiple sub-fields

Using a block in a view

Once a block type exists in the CMS, you reference it in a view file by its object key:

<?php Draw::content($content, 'pagebody') ?>

Draw::content() outputs the rendered HTML for that block. For Markdown blocks, the conversion to HTML happens automatically. For blocks that have never had content saved, the helper outputs nothing.

The full details of view files and how content reaches them are covered in Templates.


The built-in meta block

Every template automatically includes a meta_tags block. This block feeds the page's <title> and <meta description> tags. Draw::metaTags($content) is called in the shared layout template (application/views/templates/template.php) and does not need to appear in your individual view files.

You do not need to create this block — it exists by default and is always available.