anomaly.module.blocks
The Blocks Module provides a powerful way to create and manage reusable content blocks with field-based configuration.
- Field-based block content
- Area-based block organization
- Multiple instance support
- Control panel management
- Template integration
- Block caching
// In your addon service provider
protected $blocks = [
'sidebar' => [
'description' => 'Sidebar content blocks'
],
'footer' => [
'description' => 'Footer content blocks'
]
];{# Render all blocks in an area #}
{% for block in blocks('sidebar') %}
{{ block.content|raw }}
{% endfor %}
{# Get specific block #}
{% set block = block('contact_info') %}
{% if block %}
{{ block.content|raw }}
{% endif %}Navigate to Content > Blocks in the control panel to create and manage blocks.
- Streams Platform ^1.10
- PyroCMS 3.10+
- Configuration Module ^2.1+
- Settings Module ^2.1+
The Blocks Module is open-sourced software licensed under the MIT license.