Skip to content

tomashruby/kontent-custom-element-unique-textbox

Repository files navigation

Unique textbox

This custom element check whether your entered value is unique across all items in your project in specified element:

Screenshot of custom element

Configuration

{
    "codename": "unique_element",
    "request_repeater": "https://x2jp66x1y92.execute-api.eu-central-1.amazonaws.com/default/requestRepeater"
}

You need to specify both codename parameter for the element code name you want to check for unique values and you need to link your repeater in the request_repeater parameter.

To set up request_repeater above, please follow Working with sensitive data in custom elements. In Step 2: Configuring your Lambda function, use the following keys and values in the Environment variables section:

  • BEARER_TOKEN: <Preview Delivery API key>
  • HOST: preview-delivery.kontent.ai
  • PATH: /<Project ID>/items

Setup

  1. Deploy the code to a secure public host
  2. Follow the instructions in the Kentico Kontent documentation to add the element to a content model.
    • The Hosted code URL is where you deployed to in step 1
    • Pass the necessary parameters as directing in the JSON Parameters configuration section of this readme.

Deploying

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.

Deploy to Netlify

Output

The JSON output of such an element would look like this:

 "unique_element": {
        "type": "custom",
        "name": "Unique element",
        "value": "abcd"
      }

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •