PHPackages                             arillo/silverstripe-arbitrarysettings - 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. arillo/silverstripe-arbitrarysettings

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

arillo/silverstripe-arbitrarysettings
=====================================

Arbitrary settings for DataObjects

4.0.1(3mo ago)42.3k↓50%2MITPHP

Since Jan 9Pushed 3mo ago7 watchersCompare

[ Source](https://github.com/arillo/silverstripe-arbitrarysettings)[ Packagist](https://packagist.org/packages/arillo/silverstripe-arbitrarysettings)[ Docs](https://github.com/arillo/silverstripe-arbitrarysettings)[ RSS](/packages/arillo-silverstripe-arbitrarysettings/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (33)Used By (0)

arillo/silverstripe-arbitrarysettings
=====================================

[](#arillosilverstripe-arbitrarysettings)

Extends a DataObject with a mutil value field to store arbitrary settings in it.

### Requirements

[](#requirements)

SilverStripe CMS ^5.0

- For a SilverStripe 4.x compatible version of this module, please see the [2 branch](https://github.com/arillo/silverstripe-arbitrarysettings/tree/2.x).
- For a SilverStripe 3.x compatible version of this module, please see the [1 branch, or 0.x release line](https://github.com/arillo/silverstripe-arbitrarysettings/tree/1.0).

### Usage

[](#usage)

Add and setup the extension on your DataObject

e.g. in config.yml:

```
MyDataObject:
  extensions:
    # adds a field called ArbitrarySettings
    - Arillo\ArbitrarySettings\SettingsExtension

  # define your settings
  settings:
    show_title:
      options:
        0: 'No'
        1: 'Yes'
      default: 0
      label: 'Show title as image caption?'
      description: 'Additional description goes here'
    image_alignment:
      options:
        'left': 'Left'
        'right': 'Right'
      default: 'left'
      label: 'Image alignment'
```

**Note:** All keys should be alphanumeric (including underscores, haven't tested other special characters yet) and should not contain whitespace.

To add the field in CMS you can use a helper method to show the field:

```
use Arillo\ArbitrarySettings\SettingsExtension;

public function getCMSFields()
{
    $fields = parent::getCMSFields();
    if ($settingsField = SettingsExtension::field_for($this))
    {
        $fields->addFieldToTab('Root.Main', $settingsField);
    }
    return $fields;
}
```

Values can be accessed like this:

```
$this->SettingByName('image_alignment') // returns 'left' or 'right'
```

in templates:

```
...
```

`SettingsField` has functions available to manipulate the source of the field:

For including or excluding certain setting you can use:

```
// will show all settings but show_title
$settingsField->exclude(['show_title']);

// will show show_title setting only
$settingsField->include(['show_title']);
```

It is also possible to update the default value for a setting (for sure only if its present as an option):

```
$settingsField->updateDefaultForKey('show_title', 1);
```

### Settings presets

[](#settings-presets)

It is possible to define a list of setting presets like this:

```
Arillo\ArbitrarySettings\SettingsExtension:
  presets:
    bg:
      options:
        transparent: 'Transparent'
        light: 'Light blue'
      default: transparent
      label: 'Background color'
    imgType:
      options:
        Default: 'Default image'
        Hero: 'Hero image'
      default: Default
      label: 'Image type'
```

With these presets defined it is possible to reference these keys in your DataObject's settings config, e.g.:

```
MyDataObject:
  extensions:
    - Arillo\ArbitrarySettings\SettingsExtension

  # define your settings
  settings:
    - bg
    - imgType
```

### Translations

[](#translations)

To translate the form field label used by `SettingsExtension::field_for` can be changed like this:

```
en:
  Arillo\ArbitrarySettings\SettingsExtension:
    Label: 'Options'
```

To translate options follow the following convention:

```
# for a config like this:
MyObject:
  settings:
    show_title:
      options:
        0: 'No'
        1: 'Yes'
      default: 0
      label: 'Show title as image caption?'
# the following translation keys can be used:
en:
  MyObject:
    setting_show_title_option_0: 'Nope'
    setting_show_title_option_1: 'Yep'
    setting_show_title_label: 'Use title as image caption'
```

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance79

Regular maintenance activity

Popularity25

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 59.5% 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 ~106 days

Recently: every ~75 days

Total

32

Last Release

108d ago

Major Versions

1.0.x-dev → 2.0.02018-03-23

1.1.x-dev → 2.0.62020-01-22

2.1.3 → 3.0.02024-01-25

2.1.4 → 3.0.32025-03-27

3.x-dev → 4.0.02026-01-22

### Community

Maintainers

![](https://www.gravatar.com/avatar/c08728a857fbe8bcf6f7583d48a343743383d599d62357bba253755a06a85b69?d=identicon)[banglashi](/maintainers/banglashi)

![](https://www.gravatar.com/avatar/71205042f233fccd5882cdbd033b8de8f3062acbed2b19c5b16e07ccd4e2208e?d=identicon)[Arillo](/maintainers/Arillo)

---

Top Contributors

[![bumbus](https://avatars.githubusercontent.com/u/1391103?v=4)](https://github.com/bumbus "bumbus (22 commits)")[![nicolas-cusan](https://avatars.githubusercontent.com/u/1353931?v=4)](https://github.com/nicolas-cusan "nicolas-cusan (13 commits)")[![banglashi](https://avatars.githubusercontent.com/u/942981?v=4)](https://github.com/banglashi "banglashi (2 commits)")

---

Tags

phpsilverstripesilverstripeelements

### Embed Badge

![Health badge](/badges/arillo-silverstripe-arbitrarysettings/health.svg)

```
[![Health](https://phpackages.com/badges/arillo-silverstripe-arbitrarysettings/health.svg)](https://phpackages.com/packages/arillo-silverstripe-arbitrarysettings)
```

###  Alternatives

[kinglozzer/multiselectfield

A sortable multiple select field for managing many-to-many relations

1341.2k2](/packages/kinglozzer-multiselectfield)[wedevelopnl/silverstripe-elemental-grid

Elemental grid module

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

PHPackages © 2026

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