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

 

 Download package
version 1.0.3

NuGet install instructions for Umbraco 7.1.0-7.5.0

Install-Package Our.Umbraco.Switcher

Package owner

Bjarne Fyrstenborg

Bjarne Fyrstenborg

Bjarne has 3990 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
Version 8.18.x (untested)

You must login before you can report on package compatibility.

Previously reported to work on versions: 7.14.x, 7.13.x, 7.12.x, 7.7.x, 7.6.x, 7.5.x, 7.4.x, 7.3.x, 7.2.x, 7.1.x

Package Information

  • Package owner: Bjarne Fyrstenborg
  • Created: 23/01/2015
  • Current version 1.0.3
  • .NET version 4.0
  • License MIT
  • Downloads on Our: 2.4K
  • Downloads on NuGet: 28.5K
  • Total downloads : 30.9K

External resources