Provides a createSlugField function that returns a ready-made slug field row for Payload collections. By default the field is required, localized, derives from the title field and appears in the sidebar. Options let you set the source field, localization, instruction text per locale, and an overrides callback to modify or replace the result. Targets Payload 4.
Configurable slug field factory for Payload CMS.
Installation
npm i @sittari/payload-slug-field0
Stars
0
Forks
0
Open Issues
1 months ago
Last Updated
0
Weekly Downloads
v0.4.1
npm Version
18.7 KB
Unpacked Size
2
Dependencies
Trends appear after 7 days of data. Daily snapshots have not started yet.
Shared by 8 plugins in sittari-studio/payload-plugins.
Trends appear after 7 days of data. Daily snapshots have not started yet.
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/1294311885-slug-field)<a href="https://payloaddirectory.dev/plugins/1294311885-slug-field"><img src="https://payloaddirectory.dev/badge/1294311885-slug-field.svg" alt="Payload Directory"></a>README
A reusable, configurable Payload slug-field factory.
pnpm add @sittari/payload-slug-field
import { createSlugField } from '@sittari/payload-slug-field';
export const Posts = {
slug: 'posts',
fields: [
{ name: 'title', type: 'text', required: true },
createSlugField({
instruction: {
en: 'The slug becomes part of the page URL.',
uk: 'Слаг стає частиною URL сторінки.',
},
}),
],
};
createSlugField() returns Payload's slug row. It is required, localized, uses title as its source, and appears in the sidebar by default. It adds no instruction text unless instruction is provided.
Use overrides to modify or replace the completed row:
createSlugField({
useAsSlug: 'name',
localized: false,
overrides: (defaultSlugField) => ({
...defaultSlugField,
admin: { ...defaultSlugField.admin, position: 'sidebar' },
}),
});
localized slugs
Copies localized slug and full path values into a per-locale localizedSlugs field for multi-language Payload sites
650/wk9v3
permalink
WordPress-style slugs, canonical paths and permalink lookup for selected Payload collections
550/wk0v4
payload slug redirects
Records slug changes and supplies data for permanent redirects from old URLs in a Next.js frontend
340/wk3v3
redirects
Manage internal and external redirects from the Payload admin panel
100105.3k/wk45.4kv3
nested docs
Official plugin for nesting Payload documents inside one another
10090.8k/wk45.4kv3
payload page tree
Folder-based hierarchical URL slugs with a visual page tree in the Payload admin
590/wk19v3