An open API service indexing awesome lists of open source software.

https://github.com/vokseverk/vokseverk.versionnumber

A property editor for a version number (e.g. 4.3 or 8.13.9)
https://github.com/vokseverk/vokseverk.versionnumber

property-editor umbraco

Last synced: 20 days ago
JSON representation

A property editor for a version number (e.g. 4.3 or 8.13.9)

Awesome Lists containing this project

README

        

# Version Number for Umbraco

Two number inputs (at 9 and 41) inside a square with the Vokseværk ‘fire-heart’ logo

This property editor for Umbraco v10 shows two or three "number" inputs
combined to display a typical version number with major, minor and revision
digits/parts.

The configuration allows for displaying only the major and minor
or all three, depending on how granular the version your particular document
type should display.

The included `PropertyValueConverter` makes sure to return the value as a `System.Version`.

## Screenshots

### Editor

![Versionnumber Editor](images/versionnumber-editor.jpg)

### Configuration

![Versionnumber Config](images/versionnumber-config.jpg)

## Rendering

The raw value is a JSON object with the individual segments, e.g.:

```json
{
"major": 7,
"minor": 15,
"revision": 5
}
```

Using the `PropertyValueConverter` you get either the full version number or
any of its parts, like this:

```razor


Full version

@(Model.VersionNumber)

Major

@Model.VersionNumber.Major

Minor

@Model.VersionNumber.Minor

Revision

@Model.VersionNumber.Build


```

(If the editor is configured to not use the *Revision* number, the `.Build`
property is returned as `-1` and the full version only has the major and minor
parts.)

## Developing & Building

On macOS you can run the `nuget-build.sh` script from the terminal, which will
build a .nupkg file in the `dist` folder.