Skip to content

Simplified Category Management#

Simplified category management (CategoryLight) allows editors to create, edit, delete, and reorder categories directly in the category tree of the Document Browser or Media Asset Management (MAM).

The full category editor remains available for settings such as workflows, templates, and metafiles. CategoryLight is intended for focused editorial maintenance and is enabled per category.

Prerequisites#

Setup consists of four steps:

  1. Enable the feature for the Document Browser and/or MAM.
  2. Install at least one YAML configuration.
  3. Assign that configuration to the required categories.
  4. Grant category and controller permissions to the users.

No database migration or Live-System setup is required. CategoryLight operates on the category tree of the Dev-System.

Enable the feature#

Add one or both variables to site/config/system.conf on the Dev-System:

DOC_LIGHT_CATEGORY_EDIT = 1
MAM_LIGHT_CATEGORY_EDIT = 1

DOC_LIGHT_CATEGORY_EDIT enables the actions in the Document Browser; MAM_LIGHT_CATEGORY_EDIT enables them in MAM. Set a variable to 0 or remove it to disable the simplified editor in that area.

Reload the browser page after changing a variable. A server restart is not required.

Install a configuration#

Configurations are YAML files in:

site/config/catlight/

The distribution contains default.yaml.sample. Copy it to an active .yaml or .yml file before customizing it:

cp site/config/catlight/default.yaml.sample site/config/catlight/default.yaml

The filename without its extension is the configuration ID. For example, default.yaml has the ID default. IDs may contain letters, numbers, underscores, and hyphens.

Superusers can also manage these files under Structure → Category Configurations. The manager can create, upload, edit, and delete configurations and assign them to categories.

Info

A built-in configuration is available as default when no default.yaml or default.yml exists. Install a file when the form needs project-specific customization.

Assign a configuration to a category#

The active configuration ID is stored in the category metafield __imperia_editor_category. Set it in the full category editor, in the Category Configuration manager, or with admin_setcat.pl:

site/bin/admin_setcat.pl /123 meta:__imperia_editor_category:default

Replace /123 with the category node ID.

Without a valid configuration ID, the simplified actions are unavailable for that category. There is no implicit fallback to default.

When an editor creates a subcategory, the configuration is selected from the parent. The new category initially inherits the parent's normal fields and metadata; the configured CategoryLight attributes are applied afterwards.

Grant permissions#

Users need the normal read and write permissions for the affected categories. Their role must also have execute access to the required controllers:

/data/structure/category/create
/data/structure/category/edit
/data/structure/category/delete
/data/structure/category/reorder

The browser hides actions that are unavailable through controller ACLs. It disables actions when the category permission or CategoryLight configuration is missing.

Reordering uses the parent category's configuration and requires write access to every category in the sibling group.

Default configuration#

The supplied sample is:

actions:
  create: true
  edit: true
  delete: true
  reorder: true
label: Default Category Light
description: Default simplified category editor.
plugin: Default
fields:
  - id: name
    type: text
    label: Category name
    placeholder: Enter name...
    hint: The name shown in the category tree.
  - id: slug
    type: slug
    label: URL slug
    sourceField: name
    hint: Used as the new category directory below the parent category.
    edit:
      type: readonly
      hint: The category directory cannot be changed here.
  - id: description
    type: text
    label: Description
    hint: Internal description for this category.
attributes:
  - id: name
    field: name
  - id: directory
    value: "<!--SECTION:DIRECTORY-->/<!--XX-slug-->"
    set_only: create
  - id: description
    field: description

During creation, the slug follows the name until the editor changes it. The resulting directory must be unique among the new category's siblings. The slug is shown as read-only when the category is edited later.

Configure actions#

Use actions to control which commands are displayed and accepted:

actions:
  create: true
  edit: true
  delete: false
  reorder: true

Omitted actions default to enabled for compatibility. Set an action explicitly to false to disable it.

Configure form fields#

Every field requires a unique id, a type, and a label. Supported types are:

Type Purpose
text Editable single-line input
readonly Read-only value
slug Slug input optionally synchronized with another field
select Select box with options
radio Radio group with options
checkbox Boolean checkbox
toggle Boolean switch

Use an edit mapping to override a field when editing an existing category:

- id: slug
  type: slug
  label: URL slug
  sourceField: name
  edit:
    type: readonly
    hint: The directory cannot be changed after creation.

Tag inputs, ACL controls, date fields, and textareas are not supported in this version.

Set category attributes#

The attributes list maps submitted form values to category state. field copies a field value; value may contain normal imperia template syntax:

attributes:
  - id: name
    field: name
  - id: directory
    value: "<!--SECTION:DIRECTORY-->/<!--XX-slug-->"
    set_only: create
  - id: meta:channel
    field: visibility

Use set_only: create or set_only: edit to limit an attribute to one operation. Use meta:<name> to write a category metafield.

Editor behavior#

Actions open the form in the right-hand panel. While the form is unchanged, Save is disabled and the secondary button reads Close. After a change, Save is enabled and Close becomes Cancel.

Clicking outside closes an unchanged form. Unsaved changes cause a discard warning instead. During creation a temporary category is shown in the tree and is replaced with the saved category after a successful save.

Troubleshooting#

If the actions do not appear:

  • Check DOC_LIGHT_CATEGORY_EDIT or MAM_LIGHT_CATEGORY_EDIT.
  • Reload the browser page.
  • Check controller ACLs and category permissions.
  • Check the __imperia_editor_category metafield.
  • Verify that the referenced YAML file is readable and valid.