PHPackages                             nswdpc/silverstripe-imageselection-field - 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. [Image &amp; Media](/categories/media)
4. /
5. nswdpc/silverstripe-imageselection-field

ActiveSilverstripe-vendormodule[Image &amp; Media](/categories/media)

nswdpc/silverstripe-imageselection-field
========================================

Image selection field for Silverstripe.

v1.1.0(4mo ago)12371[1 PRs](https://github.com/nswdpc/silverstripe-imageselection-field/pulls)BSD-3-ClausePHP

Since Nov 10Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/nswdpc/silverstripe-imageselection-field)[ Packagist](https://packagist.org/packages/nswdpc/silverstripe-imageselection-field)[ RSS](/packages/nswdpc-silverstripe-imageselection-field/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (9)Versions (9)Used By (0)

Image Selection field for Silverstripe
======================================

[](#image-selection-field-for-silverstripe)

This is a basic radio selection field, each item in the set of options can have an image associated with it.

Useful for allowing people to select an option based on an image uploaded to the file library.

Usage
-----

[](#usage)

```
$imageList = $app->getImageList();// DataList of Image records
$width = $app->getImageWidth();
$height = $app->getImageHeight();
$sampleImageField = ImageSelectionField::create(
    'SelectedImageID',
    _t(
        'myapp.CHOOSE_AN_IMAGE',
        'Choose an image'
    )
)->setDescription(
    _t(
        'myapp.CHOOSE_AN_IMAGE_HELP',
        'Choose an image that is most relevant.'
    )
)->setImageList($imageList)
->setImageDimensions($width, $height);
```

The module provides a stylesheet using an example flexbox layout.

### Styling and templating

[](#styling-and-templating)

You will almost definitely want to use your own stylesheet, so use `Requirements::block` to block loading of the field.css stylesheet and then require your own stylesheet in your project.

To include your own template, override it in your project or theme in the usual Silverstripe way using the same file path, then flush cache.

[More information](./docs/en/001_index.md).

Template methods
----------------

[](#template-methods)

In the scope of the field:

- `{$Thumbnail($ID)}` return the current image resized to the requested image width/height, pass an Image.ID value to the method
- `{$Image($ID)}` return the current image, pass an Image.ID value to the method
- `{$Images}` return the image list
- `{$ImageWidth}` return the specified image width
- `{$ImageHeight}` return the specified image height

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

[](#installation)

```
composer require nswdpc/silverstripe-imageselection-field
```

License
-------

[](#license)

[BSD-3-Clause](./LICENSE.md)

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

[](#configuration)

You can set the default image width/height in your project configuration

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

39

—

LowBetter than 86% of packages

Maintenance74

Regular maintenance activity

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.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 ~153 days

Recently: every ~191 days

Total

6

Last Release

149d ago

Major Versions

v0.1.0 → v1.0.0-rc12023-11-10

v0.1.1 → v1.0.02024-07-29

v1.1.0 → v2.0.0-rc12025-12-15

### 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 (18 commits)")[![tardinha](https://avatars.githubusercontent.com/u/457209?v=4)](https://github.com/tardinha "tardinha (1 commits)")

---

Tags

imagesilverstripeformfieldnswselect image

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/nswdpc-silverstripe-imageselection-field/health.svg)

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

###  Alternatives

[heyday/silverstripe-responsive-images

Configure and send a series of image size options to the client without loading any resources until a media query can be executed.

5387.7k6](/packages/heyday-silverstripe-responsive-images)[unclecheese/silverstripe-image-optionset

Provides a list of selectable items that use images as the primary label instead of text.

139.1k2](/packages/unclecheese-silverstripe-image-optionset)[chrometoaster/silverstripe-image-quality

Adds Quality function to images

1013.0k1](/packages/chrometoaster-silverstripe-image-quality)[dnadesign/silverstripe-lazyloaded-image

Implements the LQIP (Low Quality Image Placeholder) pattern powered by lazysizes

1011.4k4](/packages/dnadesign-silverstripe-lazyloaded-image)

PHPackages © 2026

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