3.3.2 • Published 4 months ago

@webbio/strapi-plugin-slug v3.3.2

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

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-slug

Configuration

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 build
3.3.2

4 months ago

3.3.1

4 months ago

3.3.0

4 months ago

3.2.2

4 months ago

3.2.1

4 months ago

3.2.0

4 months ago

3.1.0

4 months ago

3.2.6

4 months ago

3.2.5

4 months ago

3.2.4

4 months ago

3.2.3

4 months ago

3.0.2

4 months ago

3.0.1

5 months ago

3.0.0

5 months ago

2.0.6

6 months ago

2.0.3

6 months ago

2.0.2

7 months ago

2.0.5

6 months ago

2.0.4

6 months ago

2.0.1

7 months ago

2.0.0

7 months ago

0.1.0

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago