Skip to content

Property editors which enable a null value to be selected in preference to a default value.

License

Notifications You must be signed in to change notification settings

Hendy/umbraco-nullable-types

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Umbraco Nullable Types

Property editors which enable a null value to be selected in preference to a default value.

The NuGet package installs a single assembly Our.Umbraco.NullableTypes.dll which has a dependency on Umbraco Embedded Resource.

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

Property Editor Configuration

Property Editor Configuration Example

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.

Property Editor

Property Editor Example

Property Editor Configuration

Property Editor Configuration Example

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

Property Editor Configuration

Property Editor Configuration Example

About

Property editors which enable a null value to be selected in preference to a default value.

Resources

License

Stars

Watchers

Forks

Packages

No packages published