PHPackages                             nswdpc/silverstripe-grid-helpers - 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. [Templating &amp; Views](/categories/templating)
4. /
5. nswdpc/silverstripe-grid-helpers

ActiveSilverstripe-vendormodule[Templating &amp; Views](/categories/templating)

nswdpc/silverstripe-grid-helpers
================================

Allow an editor to specify how lists of elements and elements should render, based on your theme

v2.0.0(3w ago)05.4k4BSD-3-ClausePHP

Since Sep 8Pushed 3w ago1 watchersCompare

[ Source](https://github.com/nswdpc/silverstripe-grid-helpers)[ Packagist](https://packagist.org/packages/nswdpc/silverstripe-grid-helpers)[ RSS](/packages/nswdpc-silverstripe-grid-helpers/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (10)Dependencies (16)Versions (17)Used By (4)

Grid helpers for Silverstripe
=============================

[](#grid-helpers-for-silverstripe)

This module provides some basic grid/display choices for Elemental elements, accessible to content editors.

Features
--------

[](#features)

- ElementChildGridExtension: apply column selection to an element containing child items (eg. `ElementList`, a gallery with images)
- ElementDisplayChoiceExtension: apply a display option to an element, for use by templates.
- ElementHasChildrenExtension: apply layout decisions to an element containing child items (eg. `ElementList`, a list of publications)

The default grid behaviour is to use the NSW Design System grid, which is quite similar to Bootstrap. You can modify this via configuration.

Configuration
-------------

[](#configuration)

The `Configuration` model is used to set base grid definitions and return strings for use as CSS classes.

You can modify values to use other grid systems, for instance to use the Bootstrap grid:

```
NSWDPC\GridHelper\Models\Configuration:
  grid_prefix: 'col'
```

Or, for [Reflex Grid](https://reflexgrid.com/#grid-introduction):

```
NSWDPC\GridHelper\Models\Configuration:
  grid_prefix: 'col'
  grid_mapping:
    xs: 'xs'
    sm: 'sm'
    md: 'md'
    lg: 'lg'
    xl: 'xlg'
```

Use `Injector` to provide your own configuration model - just remember to extend `NSWDPC\GridHelper\Models\Configuration`

Templating
----------

[](#templating)

Using the default [ElementalList template](https://github.com/dnadesign/silverstripe-elemental-list/blob/master/templates/DNADesign/ElementalList/Model/ElementList.ss) your template could look something like this:

```

{$Title}

                {$Me}

```

The above will use the selected `CardColumns` value. You can pass a value from the template to override the selection made in the CMS:

```

    {$Me}

```

In complex layouts where options are passed in templates via an `` a variable can be used:

```

    {$Me}

```

### Display choice

[](#display-choice)

The `ElementDisplayChoiceExtension` can be applied to any content-related element, to allow a content editor a degree of choice around how that content should be displayed.

Your theme/template itself will determine how this should be handled based on the value provided.

Assuming the ElementDisplayChoiceExtension was applied to ElementContent:

```

```

The module provides a number of default 'sub types' that can be selected, and you can configure your own.

### Consistent display within a list

[](#consistent-display-within-a-list)

If the relevant element is a child of an ElementalList, the display choices will be removed from the CMS and the list's display choices should be honoured in your templates. This it to avoid, for instance, a grid of items made up of differently styled content elements.

The list element, and any other Element that has the `ElementHasChildrenExtension` will gain a `List Type` and `Content style` field, for use in defining how the child items should be displayed. The default types selectable are taken from most standard design/component systems (eg. Card, Content Block, Tabs, Link list, List items).

### Templating

[](#templating-1)

As with all things Silverstripe, the frontend/template implementation is entirely up to you. This module just provides some hints as to how things should be displayed. Your theme/template should implement a solution for your user interface/component library of choice.

Maintainers
-----------

[](#maintainers)

- PD Web Team

Bugtracker
----------

[](#bugtracker)

We welcome bug reports, pull requests and feature requests on the Github Issue tracker for this project.

Please review the [code of conduct](./code-of-conduct.md) prior to opening a new issue.

Security
--------

[](#security)

If you have found a security issue with this module, please email digital\[@\]dpc.nsw.gov.au in the first instance, detailing your findings.

Development and contribution
----------------------------

[](#development-and-contribution)

If you would like to make contributions to the module please ensure you raise a pull request and discuss with the module maintainers.

Please review the [code of conduct](./code-of-conduct.md) prior to completing a pull request.

###  Health Score

51

—

FairBetter than 95% of packages

Maintenance95

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 92.7% 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 ~178 days

Recently: every ~282 days

Total

11

Last Release

23d ago

Major Versions

v0.2.0-rc4 → v1.0.0-rc12023-06-23

v0.2.0 → v1.0.02024-05-10

v1.1.0 → v2.0.02026-07-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/1caefd99092b4a43254e48c40347224f671032ec1ffc3a457e06a7e9ab6e7c02?d=identicon)[nswdpc](/maintainers/nswdpc)

---

Top Contributors

[![JamesDPC](https://avatars.githubusercontent.com/u/69664712?v=4)](https://github.com/JamesDPC "JamesDPC (38 commits)")[![tardinha](https://avatars.githubusercontent.com/u/457209?v=4)](https://github.com/tardinha "tardinha (3 commits)")

---

Tags

csselementalgridsilverstripesilverstripegridlayoutelemental

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/nswdpc-silverstripe-grid-helpers/health.svg)

```
[![Health](https://phpackages.com/badges/nswdpc-silverstripe-grid-helpers/health.svg)](https://phpackages.com/packages/nswdpc-silverstripe-grid-helpers)
```

###  Alternatives

[dnadesign/silverstripe-elemental-decisiontree

Element displaying information in regards to answers given to questions

1118.1k1](/packages/dnadesign-silverstripe-elemental-decisiontree)[wedevelopnl/silverstripe-elemental-grid

Elemental grid module

1015.1k2](/packages/wedevelopnl-silverstripe-elemental-grid)

PHPackages © 2026

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