This custom element check whether your entered value is unique across all items in your project in specified element:
{
"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
- Deploy the code to a secure public host
- See deploying section for a really quick option
- 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.
- The
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.
The JSON output of such an element would look like this:
"unique_element": {
"type": "custom",
"name": "Unique element",
"value": "abcd"
}