Socket
Book a DemoInstallSign in
Socket

strapi-plugin-auto-slug-manager-a-mi13

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

strapi-plugin-auto-slug-manager-a-mi13

Universal auto slug generator for all Strapi content types with full Rich Text support (Blocks + Classic)

1.1.0
latest
Source
npmnpm
Version published
Weekly downloads
91
5.81%
Maintainers
1
Weekly downloads
 
Created
Source

Strapi Plugin Auto Slug Manager

🔗 Universal auto slug generator for all Strapi content types with Rich Text support

✨ Features

  • Universal - Works with ANY content type that has a slug field
  • Rich Text Support - Extracts text from both Rich Text Blocks (new editor) and classic Rich Text (HTML) fields
  • Multiple Field Types - Supports string, Rich Text Blocks, and classic Rich Text fields
  • Cyrillic Support - Proper transliteration of Russian/Cyrillic characters
  • Smart Uniqueness - Automatically adds suffixes (-1, -2, -3) for unique slugs
  • Auto-discovery - Automatically finds and processes all content types with slug fields
  • Configurable - Update existing slugs or keep them unchanged
  • Admin Panel - Beautiful settings interface with real-time configuration
  • Zero Configuration - Works out of the box with sensible defaults
  • 🌐 Multi-locale Support - Choose from 8 different locales for transliteration (ru, en, de, fr, es, it, pl, tr)
  • 🎛️ Easy Configuration - Change locale directly from admin panel without code editing

🚀 Installation

npm install strapi-plugin-auto-slug-manager-a-mi13
# or
yarn add strapi-plugin-auto-slug-manager-a-mi13

⚙️ Configuration

Add the plugin to your config/plugins.js or config/plugins.ts:

module.exports = {
  'auto-slug-manager': {
    enabled: true,
    config: {
      enabled: true,                    // Enable/disable plugin globally
      sourceField: 'title',             // Primary field to generate slug from
      fallbackField: 'name',            // Fallback field if primary is empty
      handleRichText: true,             // Process Rich Text (blocks) fields
      addSuffixForUnique: true,         // Add suffixes for uniqueness
      supportCyrillic: true,            // Support Cyrillic transliteration
      updateExistingSlugs: true,        // Update existing slugs when title changes
      slugifyOptions: {
        lower: true,
        strict: true,
        locale: 'ru'
      }
    }
  }
};

📖 Usage

  • Add a slug field to any content type in your Strapi schema
  • Create or edit entries - slugs will be automatically generated from title or name fields
  • Rich Text support - Works with both regular string fields and Rich Text editor fields

Example Content Type Schema

{
  "kind": "collectionType",
  "collectionName": "articles",
  "info": {
    "singularName": "article",
    "pluralName": "articles",
    "displayName": "Articles"
  },
  "attributes": {
    "title": {
      "type": "blocks"
    },
    "slug": {
      "type": "uid",
      "targetField": "title"
    }
  }
}

🎯 How it Works

  • Auto-discovery: Plugin scans all content types for slug fields
  • Lifecycle hooks: Registers beforeCreate and beforeUpdate hooks
  • Smart text extraction: Automatically detects and processes different field types:
    • String fields → direct text extraction
    • Rich Text Blocks → extracts text from JSON structure
    • Classic Rich Text → strips HTML tags and extracts clean text
  • Slug generation: Uses slugify with Cyrillic support
  • Uniqueness check: Ensures all slugs are unique within the content type

🔧 API Endpoints

The plugin provides API endpoints for managing settings:

  • GET /auto-slug-manager/settings - Get current settings
  • PUT /auto-slug-manager/settings - Update settings
  • GET /auto-slug-manager/status - Get plugin status and discovered content types

📝 Field Types Supported

Rich Text Blocks (New Editor)

{
  "title": [
    {
      "type": "paragraph",
      "children": [
        {
          "type": "text",
          "text": "My Article Title"
        }
      ]
    }
  ]
}

Rich Text (Classic Editor)

{
  "title": "<h1>My Article Title</h1><p>Some description</p>"
}

Regular String

{
  "title": "My Article Title"
}

All three will generate: my-article-title

🌍 Multi-locale Support

The plugin supports 8 different locales for transliteration. You can change the locale directly from the admin panel:

Available Locales

LocaleLanguageExample
ruRussianМоя статьяmoya-statya
enEnglishMy Articlemy-article
deGermanMein Artikelmein-artikel
frFrenchMon Articlemon-article
esSpanishMi Artículomi-articulo
itItalianIl Mio Articoloil-mio-articolo
plPolishMój Artykułmoj-artykul
trTurkishBenim Makalembenim-makalem

How to Change Locale

  • Go to Admin Panel → Settings → Auto Slug Manager
  • Find "🔧 Настройки генерации слагов" section
  • Select your preferred locale from the dropdown
  • Click "Сохранить настройки"

Examples

Russian locale (ru):

  • Моя статьяmoya-statya
  • Тестовая записьtestovaya-zapis

English locale (en):

  • My Articlemy-article
  • Test Entrytest-entry

🔧 Development

# Clone the repository
git clone https://github.com/A-mi13/strapi-plugin-auto-slug-manager
cd strapi-plugin-auto-slug-manager

# Install dependencies
npm install

# Build the plugin
npm run build

🤝 Contributing

Contributions are welcome! Please read our contributing guidelines before submitting PRs.

📄 License

MIT License - see LICENSE file for details.

🐛 Issues

Found a bug? Please create an issue on GitHub.

Made with ❤️ for the Strapi community

Keywords

strapi

FAQs

Package last updated on 06 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.