A DB field + form fields for storing multiple values in a single property (serialized).
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
Within templates, the field can be iterated over as per a data object set.
The property $Value is available as a Varchar type, and other typical
properties such as $FirstLast etc are inherited from ViewableData.
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.
This version of MultiValueField supports SilverStripe 4.0.0
Older versions of SilverStripe are supported on minor version branches below
As with all DB fields
private static $db = array( 'Keywords' => 'MultiValueField', );
To make use of the field on the frontend, you can loop over the Items property
<% loop $Keywords.Items %> <p>$Key $Value</p> <% end_loop %>
In this case,
$Value is a Varchar object, so you can call all relevant string field methods on it, such as
$Value.LimitWordCount etc etc.
Note that to have the
$Key value available as something other than an integer, use the
KeyValueField field type to populate the field.
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 to contribute translations, rather than sending pull requests with YAML files.
This module is licensed under the BSD license at http://silverstripe.org/BSD-license
Module rating system helping users find modules that are well supported. For more on how the rating system works visit Module standards
Score not correct? Let us know there is a problem