PHPackages                             toastnz/gatedcontent - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. toastnz/gatedcontent

ActiveSilverstripe-vendormodule[Authentication &amp; Authorization](/categories/authentication)

toastnz/gatedcontent
====================

A SilverStripe module for gated content using UserDefinedForm and cookies. Provides GatedContentPage and GatedContentChildPage types with cookie-based access control.

v1.0.1(8mo ago)0346—0%BSD-3-ClausePHP

Since Aug 20Pushed 3mo agoCompare

[ Source](https://github.com/toastnz/gated-content)[ Packagist](https://packagist.org/packages/toastnz/gatedcontent)[ RSS](/packages/toastnz-gatedcontent/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (4)Used By (0)

Installation
============

[](#installation)

Install via Composer:

```
composer require toastnz/gatedcontent

```

Limitations
-----------

[](#limitations)

- This module does not currently support AJAX-enabled UserDefinedForm submissions. For the gating and redirect logic to work, AJAX must be disabled on the form.

Toast\\GatedContent SilverStripe Module
=======================================

[](#toastgatedcontent-silverstripe-module)

This module provides gated content functionality for SilverStripe projects using UserDefinedForm and cookies.

Features
--------

[](#features)

- **GatedContentPage**: Extends UserDefinedForm. When a user submits the form, a cookie is set to allow access to child pages. You can configure:
    - Custom cookie name and expiry
    - Access denied and success messages
    - Enable/disable child page protection
    - Redirect to a specific child page after submission
- **GatedContentChildPage**: Only accessible if the user has submitted the parent form (cookie-based). Cannot be created at the root level.
- **Custom Controllers**: Handles form submission, cookie setting, and access logic.
- **Session-based Redirect**: If a user tries to access a child page before submitting the form, they are redirected to the parent form. After submission, they are redirected back to the intended child page (unless a specific redirect is set).
- **Submission Storage**: Uses the default UserDefinedForm mechanism. Prune old submissions if DB size is a concern.

Usage
-----

[](#usage)

1. Place this module in your SilverStripe project root (or require via Composer).
2. Run `dev/build?flush=1`.
3. In the CMS:
    - Create a GatedContentPage, add a UserDefinedForm to it.
    - Add child pages of type GatedContentChildPage (these will be protected).
    - Configure cookie name, expiry, and redirect options as needed in the CMS fields for GatedContentPage.
4. When a user submits the form, a cookie is set. They can then access any child pages under that GatedContentPage.
5. If a user tries to access a child page before submitting the form, they are redirected to the parent form. After submission, they are redirected back to the child page (unless a specific redirect is set).

Customization
-------------

[](#customization)

- To minimize DB growth, periodically delete old submissions from the CMS.
- You can further customize the logic in the PHP classes as needed.
- You can style the form by targeting the `.no-ajax` class added to the UserDefinedForm.

Technical Details
-----------------

[](#technical-details)

- All classes are under the `Toast\GatedContent` namespace.
- Controllers and page types are in `src/Pages/`.
- The module uses SilverStripe's PSR-4 autoloading and standard conventions.

License
-------

[](#license)

MIT

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance75

Regular maintenance activity

Popularity15

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 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 ~0 days

Total

2

Last Release

261d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9cc41858b7e0e95f7c9ff396fc2d454339424c425d8f78aeb526434da6f61543?d=identicon)[priscilla-toastnz](/maintainers/priscilla-toastnz)

---

Top Contributors

[![priscillay-toast](https://avatars.githubusercontent.com/u/92568971?v=4)](https://github.com/priscillay-toast "priscillay-toast (4 commits)")

---

Tags

silverstripecookiesuser defined formgated content

### Embed Badge

![Health badge](/badges/toastnz-gatedcontent/health.svg)

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

###  Alternatives

[silverstripe/contentreview

Flags pages for periodical author review (incl. reporting)

22264.3k4](/packages/silverstripe-contentreview)[silverstripe/mfa

Enable multi-factor authentication with fallback codes

10346.1k8](/packages/silverstripe-mfa)[bigfork/silverstripe-oauth-login

SilverStripe logins via OAuth2, using the PHP League's OAuth2 client

1794.7k2](/packages/bigfork-silverstripe-oauth-login)

PHPackages © 2026

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