Skip to content

Commit

Permalink
updated documentation + screenshots
Browse files Browse the repository at this point in the history
  • Loading branch information
Hendy committed Jun 18, 2018
1 parent 69384c4 commit f9c4cc3
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 13 deletions.
39 changes: 26 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,47 @@
# Umbraco Nullable Types
Property editors which enable a null value to be selected in preference to a default value.

## _Nullable String_
'But strings are always nullable !' however with a textbox alone there's no way to distinguish between whitespace and null,
so this data-type adds a checkbox to toggle between the textbox value and a null.

The raw values are stored as json, but will also read in raw string values (as stored by the built-in textstring data-type, so can migrate away from this, but not return if item has been saved).
The property-value-converter will return a string.
## _Nullable Boolean_
A tri-state data-type where the default value is null.

The raw values are stored as strings: "", "0" or "1", which makes it compatable with the built-in true/false data-type.
The property-value-converter will return a nullable bool.

### Property Editor

![Property Editor Example](docs/NullableStringPropertyEditor.png)
![Property Editor Example](docs/NullableBooleanPropertyEditor.png)

### Property Editor Configuration

![Property Editor Configuration Example](docs/NullableStringPropertyEditorConfiguration.png)
![Property Editor Configuration Example](docs/NullableBooleanPropertyEditorConfiguration.png)


## _Nullable Boolean_
A tri-state data-type where the default value is null.
## _Nullable Integer_
Based on the built-in numeric data-type, this adds a checkbox to toggle between the integer value and a null.
The property-value-converter will return a nullable integer.

The raw values are stored as strings: "", "0" or "1", which makes it compatable with the built-in true/false data-type.
The property-value-converter will return a nullable bool.
### Property Editor

![Property Editor Example](docs/NullableIntegerPropertyEditor.png)

### Property Editor Configuration

![Property Editor Configuration Example](docs/NullableIntegerPropertyEditorConfiguration.png)


## _Nullable String_
'But strings are always nullable !' however with a textbox alone there's no way to distinguish between whitespace and null,
so this data-type adds a checkbox to toggle between the textbox value and a null.

The raw values are stored as json, but will also read in raw string values (as stored by the built-in textstring data-type, so can migrate away from this, but not return if item has been saved).
The property-value-converter will return a string.

### Property Editor

![Property Editor Example](docs/NullableBooleanPropertyEditor.png)
![Property Editor Example](docs/NullableStringPropertyEditor.png)

### Property Editor Configuration

![Property Editor Configuration Example](docs/NullableBooleanPropertyEditorConfiguration.png)
![Property Editor Configuration Example](docs/NullableStringPropertyEditorConfiguration.png)

Binary file added docs/NullableIntegerPropertyEditor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/NullableStringPropertyEditorConfiguration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f9c4cc3

Please sign in to comment.