This is a custom element for Kontent that allows users to preserve history of URL slugs.
The element watches the URL slug element and automatically preserves the old URL slug when it gets changed. Apart from that, it also allows manual entry and removal.
- Build the code
npm run build
-
Deploy the code to a secure public host
- See 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 deployed to in step 1 - Add the URL slug element 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 it to Netlify and leave you with a copy of the repository in your GitHub account as well.
The value is an array of strings (old URL slugs).
["old-url-slug", "even-older-url-slug"]