21 votes

Switcher

Switcher is a simple property editor that works as an alternative to the core true/false datatype.

It can be used for different kinds of true/false values e.g. on/off, active/deactive or enabled/disabled and gives a more visual feedback to the content editor. Furthermore it is great for content editors, who edit content from tablets, where the switch-button is touch friendly.

For labels you can use static values or localized values. To use localized values you refer to keys in language files in /Umbraco/Config/Lang/. You can use existing keys or define a new area or place the keys under an existing area.

en.xml:

<area alias="switcher">
    <key alias="enabled">Enabled</key>
    <key alias="disabled">Disabled</key>
</area>

 

da.xml:

<area alias="switcher">
    <key alias="enabled">Aktiv</key>
    <key alias="disabled">Inaktiv</key>
</area>

 

In the configuration of the datatype you then enter this format {{area_key}}:

On-label text: {{switcher_enabled}} 

Off-label text: {{switcher_disabled}} 

Release notes:

1.0.3

  • New: Nuget package build
  • New: Updated colours and switch styles
  • New: Added option to show on/off icon in toggle button

1.0.2

  • Fix: Set form $dirty property to true, so the editor see the prompt warning about unsaved changes.

1.0.1

  • New: Localization support for labels
  • Fix: Switch class conflicted with class on datepicker in Umbraco 7.1.x

1.0.0

  • Initial release

 

Package owner

Bjarne Fyrstenborg

Bjarne Fyrstenborg

Bjarne has 2994 karma points

Package Compatibility

This package is compatible with the following versions as reported by community members who have downloaded this package:
Works on Umbraco Cloud
8.0.x (untested)
7.13.x (untested)
7.12.x (untested)
7.11.x (untested)
7.10.x (untested)
7.9.x (untested)
7.8.x (untested)
7.7.x (100%)
7.6.x (100%)
7.5.x (100%)
7.4.x (100%)
7.3.x (100%)
7.2.x (100%)
7.1.x (100%)
7.0.x (untested)
6.1.x (0%)
6.0.x (0%)

You must login before you can report on package compatibility.

Package Information

  • Package owner: Bjarne Fyrstenborg
  • Created: 23/01/2015
  • Current version 1.0.3
  • .net Version 4.0
  • License MIT
  • Downloads: 2010

External resources