Skip to content

Module: Developer

Oleg Ivanchenko edited this page Oct 18, 2026 · 2 revisions

Module: Developer

The Developer module is a development tool for generating random test data. It creates tags, categories, media (placeholder images), pages, and menu items with full translations for all active languages.

Overview

This module is intended for development and testing purposes only. It helps developers quickly populate the CMS with realistic content to test themes, APIs, and frontend rendering.

Features

  • Generate 5-20 random tags with translations
  • Generate 5-20 random categories (nested hierarchy) with translations
  • Generate 5-20 placeholder images (colored rectangles)
  • Generate 5-20 published pages with tags, categories, and featured images
  • Generate 3-7 menu items in every menu (nested, linked to pages)
  • Automatic translations for all active languages
  • Track all generated items for bulk deletion
  • Clean up generated content with one click

Admin Interface

Access at Admin > Modules > Developer Tools or /admin/developer.

Dashboard

Displays counts of generated items: tags, categories, images, pages, and menu items.

Generate Test Data

Click Generate Test Data to create random content:

  1. Tags (5-20): Random words from predefined lists
  2. Categories (5-20): Nested structure (~40% root, ~40% children, ~20% grandchildren)
  3. Images (5-20): Colored placeholder JPEGs (800x600) with variants
  4. Pages (5-20): Published pages with Lorem Ipsum content, tags, categories, and featured images
  5. Menu Items (3-7 per menu): Items in every existing menu, ~40% nested, linked to pages

Each item includes translations for all active languages.

Delete All Generated Data

Click Delete All Generated Data to remove all module-generated content. Only items tracked by this module are deleted — manually created items (and the menus themselves) are preserved. Media files are removed through a persisted retry queue; if earlier cleanups are still pending, the delete is refused with an error.

Image Generation

Placeholder images are generated programmatically:

  • Size: 800x600 pixels (original)
  • Format: JPEG at 85% quality
  • Colors: 10 predefined colors
  • Variants: thumbnail (150x150), grid (256x256), small (400x300), medium (800x600), large (1920x1080), og (1200x630)
  • Location: under OCMS_UPLOADS_DIR (default ./uploads)

Routes

Method Path Description
GET /admin/developer Dashboard with statistics
POST /admin/developer/generate Generate all test data
POST /admin/developer/delete Delete all generated data

Best Practices

  1. Use in development only — The module registers inactive outside development and cannot be enabled in production
  2. Clear before regenerating — Delete existing data before creating new
  3. Check language setup — Ensure languages are configured before generating
  4. Toggle off when not needed — Disable from Admin > Modules

Troubleshooting

"No active languages found"

Ensure at least one language is active in Admin > Languages.

Slug conflicts

If you see "UNIQUE constraint failed" errors, clear the tracking table and manually delete conflicting items.

Files not deleted

Check file permissions on the ./uploads directory.

Clone this wiki locally