Skip to content

Commit

Permalink
readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
Hendy committed Jun 17, 2018
1 parent 4068cfa commit 5bc6f5b
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,34 @@
# Umbraco Nullable Types
Property editors (and value converters) to 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.


### Property Editor

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

### Property Editor Configuration

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


## _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.

## _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.
### Property Editor

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

### Property Editor Configuration

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

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

0 comments on commit 5bc6f5b

Please sign in to comment.