Skip to content
SprecherEast
Issue 633

feat: Limit content titles to 60 characters so they fit breadcrumbs, cards and search results

Back to our plan
Done
enhancementcmspriority: medium

Problem

In plain words: nothing stops someone from typing a very long title for a post or event. A long title looks strange on the page, wraps badly on a phone, and doesn't fit in the breadcrumb trail above the article.

Summary of the owner's request (2026-11-03, Claude voice session): set a character limit on titles, so an oversized title can't be published by accident, look odd on the page, or overflow the breadcrumbs. He had just shortened the I-94 post's title to "A new way onto I-94 at Milwaukee Street" (39 characters).

Proposed fix

Give every content collection's title a maximum length, in the one place they share it: titleField() in src/platform/payload/contentCollection.ts, with the number as one exported constant (TITLE_MAX_LENGTH) so the admin field, the tests and the breadcrumb all agree.

Decision (routine technical choice, recorded here per AGENTS.md): 60 characters. It is about what a search result shows of a title before cutting it, and the longest titles on the site today are well under it. The owner can change the number in one place.

Native first (checked, in order):

  1. Payload native: a text field's maxLength option. The editor refuses a longer title when it is published (Payload shows no live counter; the field's note states the limit). This does the job; no custom code.
  2. Official plugins: not needed.
  3. Third-party: not needed.

Things to check while doing it:

  • Existing titles longer than the limit stay readable but can't be saved again until shortened. List any (seed data and the live posts/events/pages) and shorten them first, so no editor is surprised.
  • The breadcrumb must still cope with a long title that predates the limit (that is the breadcrumbs issue, which truncates one line with an ellipsis).

Acceptance criteria

  • Not done: TITLE_MAX_LENGTH is defined once and used by titleField(); posts, events and pages inherit it with no copy.
  • Not done: In Payload admin the title field shows a note with the limit and refuses to publish a title over it (test proves it).
  • Not done: No seed title is over the limit, and any live title over it is listed on this issue.
  • Not done: A short note in the editor guidance says why the limit exists.

Area

cms

Priority

priority: medium


Generated by Claude Code, opens in a new tab

See it on GitHub, opens in a new tab