|
1 |
| -# Field: Unique Text Input |
| 1 | +# Unique Text Input Field for Symphony CMS |
2 | 2 |
|
3 |
| -Makes the value's handle unique across the section |
| 3 | +A field for [Symphony CMS][ext-symphony-cms] that enforces uniqueness |
| 4 | + |
| 5 | +- [Installation](#installation) |
| 6 | +- [Requirements](#dependencies) |
| 7 | +- [Dependencies](#dependencies) |
| 8 | +- [Basic Usage](#basic-usage) |
| 9 | +- [Support](#support) |
| 10 | +- [Contributing](#contributing) |
| 11 | +- [License](#license) |
4 | 12 |
|
5 | 13 | ## Installation
|
6 | 14 |
|
7 |
| -1. Upload the `/uniqueinputfield` folder to your Symphony `/extensions` folder. |
| 15 | +Clone the latest version to your `/extensions` folder and run composer to install required packaged with |
| 16 | + |
| 17 | +### Manually (git + composer) |
| 18 | +```bash |
| 19 | +$ git clone https://github.com/pointybeard/symext-field-unique-input.git field_uniquetextinput |
| 20 | +$ composer update -vv --profile -d ./field_uniquetextinput |
| 21 | +``` |
| 22 | +After finishing the steps above, enable "Section Model Builder" though the administration interface or, if using [Orchestra][ext-orchestra], with `bin/extension enable field_uniquetextinput`. |
| 23 | + |
| 24 | +### With Orchestra |
| 25 | + |
| 26 | +1. Add the following extension defintion to your `.orchestra/build.json` file in the `"extensions"` block: |
| 27 | + |
| 28 | +```json |
| 29 | +{ |
| 30 | + "name": "field_uniquetextinput", |
| 31 | + "repository": { |
| 32 | + "url": "https://github.com/pointybeard/symext-field-unique-input.git" |
| 33 | + } |
| 34 | +} |
| 35 | +``` |
| 36 | + |
| 37 | +2. Run the following command to rebuild your Extensions |
| 38 | + |
| 39 | +```bash |
| 40 | +$ bin/orchestra build \ |
| 41 | + --skip-import-sections \ |
| 42 | + --database-skip-import-data \ |
| 43 | + --database-skip-import-structure \ |
| 44 | + --skip-create-author \ |
| 45 | + --skip-seeders \ |
| 46 | + --skip-git-reset \ |
| 47 | + --skip-composer \ |
| 48 | + --skip-postbuild |
| 49 | +``` |
| 50 | + |
| 51 | +# Requirements |
| 52 | + |
| 53 | +- This extension works with PHP 7.4 or above. |
8 | 54 |
|
9 |
| -2. Enable it by selecting the "Field: Unique Text Input", choose Enable from the with-selected menu, then click Apply. |
| 55 | +# Dependencies |
10 | 56 |
|
11 |
| -3. You can now add the "Unique Text Input" field to your sections. |
| 57 | +This extension depends on the following Composer libraries: |
12 | 58 |
|
| 59 | +- [PHP Helpers][dep-helpers] |
| 60 | +- [Symphony CMS: Extended Base Class Library][dep-symphony-extended] |
13 | 61 |
|
14 | 62 | ## Usage
|
15 | 63 |
|
16 |
| -- Behaves identically to a normal text input, however it enforces uniqueness of the handle and you cannot group the output in Data Sources. |
| 64 | +Enable this field via the interface and add it to your sections like any other field. |
| 65 | + |
| 66 | +This field behaves identically to a standard text input field, however, it enforces uniqueness of the handle. Note, output in Data Sources cannot be grouped by a Unique Text Input field. |
| 67 | + |
| 68 | +There are two (2) modes which allow the choice between throwing an error, e.g. "This must be unique", or maintain uniqueness by automatically by appending a number to the handle value, eg. `my-entry-handle-2`. |
| 69 | + |
| 70 | +## Support |
| 71 | + |
| 72 | +If you believe you have found a bug, please report it using the [GitHub issue tracker][ext-issues], |
| 73 | +or better yet, fork the library and submit a pull request. |
| 74 | + |
| 75 | +## Contributing |
| 76 | + |
| 77 | +We encourage you to contribute to this project. Please check out the [Contributing to this project][doc-contributing] documentation for guidelines about how to get involved. |
| 78 | + |
| 79 | +## Author |
| 80 | +- Alannah Kearney - http://github.com/pointybeard |
| 81 | +- See also the list of [contributors][ext-contributor] who participated in this project |
| 82 | + |
| 83 | +## License |
| 84 | +"Unique Text Input Field for Symphony CMS" is released under the MIT License. See [LICENCE][doc-licence] for details. |
17 | 85 |
|
18 |
| -- Two modes allow you to choose between throwing an error, "This must be unique", or attempting to make the handle unique automatically by appending an number, eg. `my-entry-handle-2` |
| 86 | +[doc-contributing]: https://github.com/pointybeard/symext-field-unique-input/blob/master/CONTRIBUTING.md |
| 87 | +[doc-licence]: http://www.opensource.org/licenses/MIT |
| 88 | +[dep-helpers]: https://github.com/pointybeard/helpers |
| 89 | +[dep-symphony-extended]: https://github.com/pointybeard/symphony-extended |
| 90 | +[ext-issues]: https://github.com/pointybeard/symext-field-unique-input/issues |
| 91 | +[ext-symphony-cms]: http://getsymphony.com |
| 92 | +[ext-orchestra]: https://github.com/pointybeard/orchestra |
| 93 | +[ext-contributor]: https://github.com/pointybeard/symext-field-unique-input/contributors |
0 commit comments