Skip to content

Feature request: configurable redirect after creating a collection item #1620

Description

@mako82541-del

When creating a new collection item, Keystatic currently redirects to the newly created item's edit page.

For some editorial workflows, it would be useful to optionally return to the collection list instead.

Example use case:

  • editor opens a collection
  • clicks "Add"
  • fills the form
  • clicks "Create"
  • item is saved
  • editor is returned to the collection list and can immediately add another item

In a real user test, staying on the newly created item's edit page caused confusion: the editor thought the form was ready for the next item and started editing the item that had just been created.

A collection-level option could perhaps look like:

afterCreate: 'item' | 'collection'

with the current behaviour remaining the default.

For my project, changing:

router.push(${collectionPath}/item/${encodeURIComponent(slug)});

to:

router.push(collectionPath);

produces the desired behaviour.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions