PHPackages                             touchcast/modulator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. touchcast/modulator

ActiveSilverstripe-module[Utility &amp; Helpers](/categories/utility)

touchcast/modulator
===================

A SilverStripe module for dynamically creating pages from smaller components

0.14(9y ago)04.9k3PHP

Since Mar 25Pushed 6y ago2 watchersCompare

[ Source](https://github.com/touchcast/modulator)[ Packagist](https://packagist.org/packages/touchcast/modulator)[ RSS](/packages/touchcast-modulator/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (5)Versions (15)Used By (0)

SilverStripe Modulator
======================

[](#silverstripe-modulator)

[![Travis](https://camo.githubusercontent.com/13be56e86d250f04a23fcd86795e82c96d4de943c41397ab8fec92efcc9e2640/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f746f756368636173742f6d6f64756c61746f722e737667)](https://travis-ci.org/touchcast/modulator)[![Packagist](https://camo.githubusercontent.com/51e04368634e7ed2886a6ee55ec24fa33fff39340735f05584be1410d93a55c0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746f756368636173742f6d6f64756c61746f722e737667)](https://packagist.org/packages/touchcast/modulator)[![Packagist](https://camo.githubusercontent.com/2f00960ba8690343920f8346c37daa5152ad9aea9688e834d412047bd756c7af/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746f756368636173742f6d6f64756c61746f722e737667)](https://packagist.org/packages/touchcast/modulator)

Modulator is an extendable system for creating sub-page components. It achieves this by attaching DataObjects to the page in place of the traditional Content body.

Features
--------

[](#features)

- Draft and publish control on a per-module level
- Drag-and-drop re-ordering of modules
- An extendable system for creating your own modules
- CMS previewing
- Filtering of available modules per page type

Installation
------------

[](#installation)

Modulator can be installed via Composer;

```
composer require touchcast/modulator

```

After installing, run a `/dev/build` to generate the database tables.

Usage
-----

[](#usage)

Create a `ModularPage` page within your Site Tree. Add new modules to the page and populate them as required.

Creating modules
----------------

[](#creating-modules)

Each module consists of a PHP class and a template file.

Start by extending `PageModule`

```
class HeroModule extends PageModule {

  // Give the module a name for use within the CMS
  public static $label = "Hero module";

  // Give it a description
  public static $description = "A large title section at the top of the page";

  // Optionally group your modules by type, for easy reference in the CMS
  public static $category = "Headers";

  // Add any fields required for the module
  private static $db = array(
    "Heading" => "Varchar(128)"
  );

  // Provide custom summary content for the gridfield
  public function getSummaryContent() {
    return $this->Heading;
  }

  // Provide text content from the module to be included in the pages's search index
  public function getSearchBody() {
    return $this->Heading;
  }
}
```

Next create a template file. It should have the same name as your module class.

```

  $Heading

```

If you want to extend the `ModularPage` template, you can render the modules by hand using the `$ActiveModules` loop.

```

  $Content

```

Filtering available modules
---------------------------

[](#filtering-available-modules)

For each page class you extend from `ModularPage` you can specify a list of modules which are allowed to be attached to that page. e.g;

```
class CustomPage extends ModularPage {

  public static $allowed_modules = array(
    'HeroModule',
    'TextModule'
  );
}
```

Custom base modules
-------------------

[](#custom-base-modules)

If you want to create a custom base class for page modules to contain any common fields, you can specifiy this in a config file;

```
ModularPage:
  base_class: CustomModuleBase
```

You can take this a step further and specify a different base class for each page type (as an alternative to using `$allowed_modules`);

```
ModularPage:
  base_class: CustomModuleBase

BlogPage:
  base_class: BlogModuleBase
```

Search body population
----------------------

[](#search-body-population)

The default behaviour is to populate the SiteTree `Content` field with the contents of all the page's modules, so that it can be indexed by Silverstripe's built-in search functionality. If you don't want this behaviour you can disable it on a per-class basis;

```
ModularPage:
  write_content: true

BlogPage:
  write_content: false
```

Testing
-------

[](#testing)

Run `phpunit` from within the module folder, or `/dev/tests` from the browser.

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~29 days

Recently: every ~71 days

Total

14

Last Release

3368d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3588951?v=4)[Touchcast](/maintainers/touchcast)[@touchcast](https://github.com/touchcast)

---

Top Contributors

[![andrewjoll](https://avatars.githubusercontent.com/u/118745?v=4)](https://github.com/andrewjoll "andrewjoll (32 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/touchcast-modulator/health.svg)

```
[![Health](https://phpackages.com/badges/touchcast-modulator/health.svg)](https://phpackages.com/packages/touchcast-modulator)
```

###  Alternatives

[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.3k10](/packages/helsingborg-stad-municipio)[mautic/core

Mautic Open Source Distribution

9.8k2.6k9](/packages/mautic-core)[mediawiki/maps

Adds various mapping features to MediaWiki

84152.3k3](/packages/mediawiki-maps)[rainlab/blog-plugin

Blog plugin for October CMS

17158.6k](/packages/rainlab-blog-plugin)[civicrm/civicrm-drupal-8

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

19246.3k2](/packages/civicrm-civicrm-drupal-8)[starcitizentools/citizen-skin

A beautiful, usable, responsive MediaWiki skin with in-depth extension support. Originally developed for the Star Citizen Wiki.

3355.8k](/packages/starcitizentools-citizen-skin)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
