Add short descriptions to categories and collections
Problem
Category and collection pages often require two separate content areas:
- a short introductory description displayed below the page title and above the product list;
- the existing rich-text description displayed below the product list.
Currently, Saleor provides only one translatable rich-text description field. Using metadata for the short description provides no typed API, standard validation, or translation support.
Proposed solution: add a translatable plain-text shortDescription field to categories and collections.
Discord Discussion Link
https://discord.com/channels/864066819866624010/1527307080263008336
General Assumptions
- ShortDescription is optional plain text.
- The existing description field remains unchanged and continues to store Editor.js rich content.
- The field is supported for both categories and collections.
- The field is supported by create, update, query, and translation operations.
- Existing MANAGE_PRODUCTS and MANAGE_TRANSLATIONS permissions apply.
- Existing category, collection, and translation webhooks are triggered when the field changes.
- The change is backward-compatible and does not modify existing API behaviour.
- Empty values are accepted and returned consistently.
- Reading and updating the field should not introduce additional queries or meaningful performance overhead.
- The field must work efficiently for large category and collection datasets.
API Changes
No new mutations are required.
Add shortDescription: String to:
- Category
- Collection
- CategoryTranslation
- CollectionTranslation
- category and collection translatable content types
Add shortDescription to:
- CategoryInput
- CollectionInput
- category translation input
- collection translation input
- relevant bulk translation inputs, if supported
The existing category and collection create, update, and translation mutations should accept the new field.
Database Changes
Add an optional plain-text field to:
- Category
- Collection
- CategoryTranslation
- CollectionTranslation
Suggested model field:
short_description = models.TextField(blank=True)
UML Diagrams
No response
To Do List
- Add database fields and migrations.
- Expose the fields in Category and Collection GraphQL types.
- Extend create and update mutation inputs.
- Extend translation types and mutation inputs.
- Support the field in bulk translation operations where applicable.
- Ensure existing permissions are applied.
- Ensure existing webhooks are triggered on changes.
- Add API tests for create, update, query, clear, and translation use cases.
- Add permission and error-handling tests.
- Update GraphQL API documentation.
Testing Requirements
No response
Source: saleor/saleor