Skip to content

Switch is a Grid-compatible Field Type add-on for ExpressionEngine that enables easy either-or switches.

License

Notifications You must be signed in to change notification settings

clickrain/switch

Repository files navigation

Switch

Switch is a Grid-compatible Field Type add-on for ExpressionEngine that enables easy either-or switches.

A note about support

While we have incentive to keep this project working because we use it frequently, we are not always available to provide support for the Switch plugin. We therefore offer it to you, free of charge, but with no guarantee of support. Find something that's not working? Or could be improved? By all means, fix it! Submit a pull request, and we'll pull it into the project so everyone can benefit. But please, no hard feelings if we can't help you when it's not working. Go forth and Open Source.

Requirements

  • EE 2.7

Installation

  1. Copy the "system/expressionengine/third_party/switch" folder to ExpressionEngine's third-party add-ons directory. (e.g. /system/expressionengine/third_party/)
  2. Copy the "themes/third_party/switch" folder to ExpressionEngine's third- party themes directory. (e.g. /themes/third_party/switch/)
  3. Log into your ExpressionEngine control panel.
  4. Open the Field Types tab.
  5. Click "Install" by "Switch".

Usage

Set "Switch" as the Field Type.

Events

Each Switch field will trigger a custom jQuery event when the user changes the value.

$('#hold_field_7 .switch').on('switchChange', function(e) {
	var position = e.switchPosition; // The position of the option (1, 2, ..., 8)
	var value = e.switchValue; // The selected option's value
	var text = e.switchText; // The selected option's text
	var color = e.switchColor; // The selected option's color
});

License

Switch is distributed under the MIT license. See LICENSE.md for more information.

About

Switch is a Grid-compatible Field Type add-on for ExpressionEngine that enables easy either-or switches.

Resources

License

Stars

Watchers

Forks

Packages

No packages published