docs(quick-261009-mgk): add the category content field to sm-journal-plugin (D-21)

This commit is contained in:
2026-10-09 16:29:19 +02:00
parent 56f3d9c59f
commit 5ba1a4ae1d
4 changed files with 564 additions and 10 deletions

View File

@@ -0,0 +1,17 @@
---
created: 2026-10-09T14:30:00Z
title: Add a richeditor (HTML WYSIWYG) admin field type to cabana
area: framework
severity: minor
files:
- modules/cabana/form_schema.go
- ../sm-journal-plugin/models/category/fields.yaml
---
## Problem
D-21 asks for a rich content field on Journal categories. cabana has no WYSIWYG field type, so category content is edited as raw HTML in a `textarea` (size huge). The `markdown` and `mlmarkdown` fields cannot hold HTML, because their preview omits raw HTML as `<!-- raw HTML omitted -->`.
## Solution
Add a `richeditor` field type (and an `mlricheditor` variant if a translatable rich field is needed) to the cabana form schema (`modules/cabana/form_schema.go`) and to the admin SPA. Keep the server-side gate on save: the Journal plugin's `classes.CheckHTML` runs in the Categories controller's `FormBeforeCreate` and `FormBeforeUpdate`, and the new field type must not bypass it. Then switch the Journal category `content` field in `models/category/fields.yaml` from `textarea` to `richeditor`.