Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add prefix & suffix options #61

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion content/docs/widgets/boolean.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ The boolean widget translates a toggle switch input to a true/false value.
- **Data type:** boolean
- **Options:**
- `default`: accepts `true` or `false`; defaults to `false` when `required` is set to `false`
- `prefix`: <a href="https://github.com/decaporg/decap-cms/releases/tag/decap-cms%403.1.6" class="version-tag">3.1.6</a> display a message before the toggle; accepts a string; defaults to an empty string
- `suffix`: display a message after the toggle; accepts a string; defaults to an empty string
- **Example:**
```yaml
- {label: "Draft", name: "draft", widget: "boolean", default: true}
- {label: "Draft", name: "draft", widget: "boolean", default: true, prefix: "OFF", suffix: "ON"}
```
3 changes: 3 additions & 0 deletions content/docs/widgets/number.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ The number widget uses an HTML number input, saving the value as a string, integ
- `min`: accepts a number for minimum value accepted; unset by default
- `max`: accepts a number for maximum value accepted; unset by default
- `step`: accepts a number for stepping up/down values in the input; 1 by default
- `prefix`: <a href="https://github.com/decaporg/decap-cms/releases/tag/decap-cms%403.1.6" class="version-tag">3.1.6</a> display a message before the number input; accepts a string; defaults to an empty string
- `suffix`: display a message after the number input; accepts a string; defaults to an empty string
- **Example:**
```yaml
- label: "Puppy Count"
Expand All @@ -24,4 +26,5 @@ The number widget uses an HTML number input, saving the value as a string, integ
min: 1
max: 101
step: 2
suffix: "puppies"
```
2 changes: 2 additions & 0 deletions content/docs/widgets/string.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ The string widget translates a basic text input to a string value. For larger te
- **Data type:** string
- **Options:**
- `default`: accepts a string; defaults to an empty string
- `prefix`: <a href="https://github.com/decaporg/decap-cms/releases/tag/decap-cms%403.1.6" class="version-tag">3.1.6</a> display a message before the string input; accepts a string; defaults to an empty string
- `suffix`: display a message after the string input; accepts a string; defaults to an empty string
- **Example:**
```yaml
- {label: "Title", name: "title", widget: "string"}
Expand Down