@zetesis/payload-taxonomies
v0.1.0
Published
Taxonomies for Payload CMS
Downloads
56
Readme
@zetesis/payload-taxonomies
Hierarchical taxonomy collection and relationship utilities for Payload CMS.
Installation
pnpm add @zetesis/payload-taxonomiesUsage
// payload.config.ts
import { taxonomiesCollection } from '@zetesis/payload-taxonomies'
export default buildConfig({
collections: [
taxonomiesCollection(),
// your other collections...
],
})// In another collection
import { buildTaxonomyRelationship } from '@zetesis/payload-taxonomies'
const PostsCollection = {
slug: 'posts',
fields: [
buildTaxonomyRelationship({ hasMany: true }),
// other fields...
],
}Exports
Main (.)
taxonomiesCollection- Pre-configured taxonomy collection builderbuildTaxonomyRelationship- Helper to create taxonomy relationship fieldsCOLLECTION_SLUG_TAXONOMY- Collection slug constant
Constants (./constants)
COLLECTION_SLUG_TAXONOMY- Lightweight import for the slug constant only
Architecture
Seed Integration
The app-level seed system uses these functions (in apps/server/src/seed/):
ensureTaxonomiesExist -> seedTaxonomy -> resolveNumericTaxonomybuildTaxonomySearchFields generates Typesense-compatible fields from taxonomy data for indexing.
Search Integration
transformCategories (app-level, apps/server/src/payload/plugins/typesense/transforms.ts) converts Payload taxonomy documents to Typesense-indexable format, extracting slugs and names for faceted search.
Features
- Pre-built hierarchical taxonomy collection with slug generation
- Localized taxonomy names
- Custom JSON payload field for metadata
- Relationship helper for integrating taxonomies into other collections
- Optional TypeScript schema for typed JSON payloads
Peer Dependencies
payload^3.75.0@payloadcms/ui^3.75.0react^19.0.0
License
MIT
