Skip to content

Commit

Permalink
Merge pull request #95 from creative-commoners/pulls/6.0/cms5-readme
Browse files Browse the repository at this point in the history
DOC Update README.md for CMS 5
  • Loading branch information
sabina-talipova authored Apr 24, 2023
2 parents 9368cfb + fc7c4ae commit 6ff3a6b
Showing 1 changed file with 9 additions and 25 deletions.
34 changes: 9 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
[![CI](https://github.com/symbiote/silverstripe-multivaluefield/actions/workflows/ci.yml/badge.svg)](https://github.com/symbiote/silverstripe-multivaluefield/actions/workflows/ci.yml)
[![Silverstripe supported module](https://img.shields.io/badge/silverstripe-supported-0071C4.svg)](https://www.silverstripe.org/software/addons/silverstripe-commercially-supported-module-list/)

Notes:

* The Silverstripe 2.4 compatible version of the module is still available in the ss24 branch
* The Silverstripe 3.x compatible versions are still available in the 2.x branches. (see version info)

A database field type that allows the storage of multiple discrete values in
a single database field. This also provides form fields for entering multiple
values in a simple manner
Expand All @@ -26,28 +21,20 @@ Data is stored in the database in a serialized PHP format. While this is not
ideal for searching purposes, some external indexing engines (eg the Solr
module) are aware of the field type and will index accordingly.

## Version info

This version of MultiValueField supports Silverstripe 4.0.0

Older versions of Silverstripe are supported on minor version branches below

* [Silverstripe 3.1+ compatible version](https://github.com/symbiote/silverstripe-multivaluefield/tree/2.4)

## Installation

```
```sh
composer require symbiote/silverstripe-multivaluefield
```

## Basic Usage

As with all DB fields

```
private static $db = array(
'Keywords' => 'MultiValueField',
);
```php
private static $db = [
'Keywords' => 'MultiValueField',
];
```

To make use of the field on the frontend, you can loop over the Items property
Expand All @@ -63,7 +50,8 @@ In this case, `$Value` is a Varchar object, so you can call all relevant string
Note that to have the `$Key` value available as something other than an integer, use the `KeyValueField` field type to populate the field.

You can set the key and value placeholder values of the KeyValueField in your field like this:
```

```php
$kvf = KeyValueField::create(
'MultiChoiceAnswer',
'Multiple Choice Answers'
Expand All @@ -76,10 +64,6 @@ $kvf->setKeyFieldPlaceholder('Label');

* Marcus Nyeholt <[email protected]>

## Requirements

* Silverstripe 4.0

## Contributing

### Thanks
Expand All @@ -91,11 +75,11 @@ $kvf->setKeyFieldPlaceholder('Label');

Translations of the natural language strings are managed through a third party translation interface, transifex.com. Newly added strings will be periodically uploaded there for translation, and any new translations will be merged back to the project source code.

Please use [https://www.transifex.com/projects/p/silverstripe-multivaluefield](https://www.transifex.com/projects/p/silverstripe-multivaluefield) to contribute translations, rather than sending pull requests with YAML files.
Please use [https://app.transifex.com/silverstripe/silverstripe-multivaluefield/](https://app.transifex.com/silverstripe/silverstripe-multivaluefield/) to contribute translations, rather than sending pull requests with YAML files.

## License

This module is licensed under the BSD license at http://silverstripe.org/BSD-license
This module is licensed under the BSD license at https://silverstripe.org/BSD-license

## Project Links
* [GitHub Project Page](https://github.com/nyeholt/silverstripe-multivaluefield)
Expand Down

0 comments on commit 6ff3a6b

Please sign in to comment.