diff --git a/README.md b/README.md index 586afcb..e1428aa 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,38 @@ -# kc_inputs +# Toggle Switch Custom Element for Kentico Kontent -This KC custom element is jsut a simple switch -> on/off +This is a [custom element](https://docs.kontent.ai/tutorials/develop-apps/integrate/integrating-your-own-content-editing-features) for [Kentico Kontent](https://kontent.ai) that allows you to toggle a switch on or off. -You can test it by configuring https://amend.cz/inputs/switch.html url for your custom element. +![screenshot](ToggleSwitch.png) -![screenshot](https://amend.cz/inputs/switch.png) +## Setup -You can specify the Parameters {JSON} part of the configuration to configure the default state or a lable. -Possible configurations: +1. Deploy the code to a secure public host + * See [deploying section](#Deploying) for a really quick option +1. Follow the instructions in the [Kentico Kontent documentation](https://docs.kontent.ai/tutorials/develop-apps/integrate/integrating-your-own-content-editing-features#a-3--displaying-a-custom-element-in-kentico-kontent) to add the element to a content model. + * The `Hosted code URL` is where you deployed to in step 1 + * Pass any desired optional parameters as directing in the [JSON Parameters configuration](#json-parameters) section of this readme. -(empty) +## Deploying -{ "default": true } +Netlify has made this easy. If you click the deploy button below, it will guide you through the process of deploying it to Netlify and leave you with a copy of the repository in your GitHub account as well. -{ - "label": "Confirmed" -} +[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/hzik/kc_inputs) + +## JSON Parameters + +You are not required to specify any parameters to use this custom element. If desired, you can configure the default state or a label for the toggle. +`default` is an optional boolean value indicating the default state of the toggle on first load. + +`label' is an optional string value used as the label to the right of the toggle to provide additional context to an editor. + +```Json { "default": true, - "label": "Accepted" + "label": "Featured" } +``` + +## Saved Value + +The value is saved as a string of true or false representing the switch's state. diff --git a/ToggleSwitch.png b/ToggleSwitch.png new file mode 100644 index 0000000..c7f1b28 Binary files /dev/null and b/ToggleSwitch.png differ diff --git a/switch.html b/index.html similarity index 89% rename from switch.html rename to index.html index 895773f..0022054 100644 --- a/switch.html +++ b/index.html @@ -1,166 +1,166 @@ - - - - - Switch - - - - - - - - - - -
-
- - - -
- - - - - + + + + + Switch + + + + + + + + + + +
+
+ + + +
+ + + + +