This custom element for Kontent.ai enables users to preserve history of URL slugs.
The element watches the URL slug element for changes. When the slug changes, the element automatically saves the previous URL slug to a history list. It's also possible to manually add and remove history entries.
- Build the code
npm run build
-
Deploy the code to a secure public host
- See the deploying section for a really quick option
-
Follow the instructions in the custom elements documentation to add the element to a content model.
- The
Hosted code URL
is where you've deployed the element to in step 1. - Add the URL slug element's codename into configuration.
- The
The custom element may only be used for content types that contain the URL slug element. The configuration of the custom element looks like this:
{
"urlSlugElementCodename": "{codename of the URL slug element}"
}
This configuration is required and the custom element won't work without it.
Netlify has made this easy. If you click the deploy button below, it will guide you through the process of deploying the element to Netlify and leave you with a copy of this repository in your GitHub account as well.
The value is an array of strings (old URL slugs).
["old-url-slug", "even-older-url-slug"]