anomaly/blocks-module

Manage sections of content.

Installs: 2 314

Dependents: 9

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 7

Type:streams-addon

pkg:composer/anomaly/blocks-module

v1.5.0 2025-12-04 02:05 UTC

README

anomaly.module.blocks

Manage sections of content.

The Blocks Module provides a powerful way to create and manage reusable content blocks with field-based configuration.

Features

  • Field-based block content
  • Area-based block organization
  • Multiple instance support
  • Control panel management
  • Template integration
  • Block caching

Usage

Defining Block Areas

// In your addon service provider
protected $blocks = [
    'sidebar' => [
        'description' => 'Sidebar content blocks'
    ],
    'footer' => [
        'description' => 'Footer content blocks'
    ]
];

Rendering 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 %}

Creating Blocks

Navigate to Content > Blocks in the control panel to create and manage blocks.

Requirements

  • Streams Platform ^1.10
  • PyroCMS 3.10+
  • Configuration Module ^2.1+
  • Settings Module ^2.1+

License

The Blocks Module is open-sourced software licensed under the MIT license.