@webbio/strapi-plugin-slug v4.0.9
Strapi plugin slug
Features
- A custom slug field that generates a unique slug based on the entity's title.
- Generates a path based on the entity's slug and its parent paths.
- Checks if a slug is unique based on the entity's parent paths and its domain.
Installation
To install this plugin, you need to add an NPM dependency to your Strapi application.
# Using Yarn
yarn add @webbio/strapi-plugin-slug
# Or using NPM
npm install @webbio/strapi-plugin-slugConfiguration
The custom field must be added together with two other fields (path and parent). In the slug pluginOptions make sure the field and targetField are set correctly.
...schema.json
// ...
"slug": {
"pluginOptions": {
"i18n": {
"localized": true
},
"slug": {
"field": "slug",
"targetField": "title"
}
},
"type": "customField",
"customField": "plugin::slug.slug",
"required": false
},
"path": {
"pluginOptions": {
"i18n": {
"localized": true
}
},
"type": "string",
"required": false
},
"parent": {
"type": "relation",
"relation": "oneToOne",
"target": "api::page.page"
}
// ..../config/plugins.ts
module.exports = ({ env }) => ({
// ...
slug: {
enabled: true
}
// ...
});Then, you'll need to build your admin panel:
# Using Yarn
yarn build
# Or using NPM
npm run build10 months ago
10 months ago
10 months ago
10 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago