Skip to content

Auto-slug generation broken in website template #14039

@ali-issa

Description

@ali-issa

Describe the Bug

The slug field doesn't auto-generate from the title when creating new pages in the website template. Users must manually click on the generate button instead of having them automatically generated from page titles.

Might be related to #12956

const { dispatchFields, getDataByPath } = useForm()

getDataByPath may not be returning the current value reliably, or there could be timing issues with when the form data is available.

Link to the code that reproduces this issue

https://github.com/payloadcms/payload

Reproduction Steps

  1. Run pnpm create-payload-app@latest and select the website template
  2. Open the admin dashboard and go to Pages
  3. Create a new page and enter a title
  4. The slug field remains empty instead of auto-generating

Which area(s) are affected? (Select all that apply)

area: templates

Environment Info

Binaries:
  Node: 23.10.0
  npm: 11.3.0
  Yarn: 1.22.22
  pnpm: 10.15.1
Relevant Packages:
  payload: 3.58.0
  next: 15.4.4
  @payloadcms/email-nodemailer: 3.58.0
  @payloadcms/graphql: 3.58.0
  @payloadcms/live-preview: 3.58.0
  @payloadcms/live-preview-react: 3.58.0
  @payloadcms/next/utilities: 3.58.0
  @payloadcms/payload-cloud: 3.58.0
  @payloadcms/plugin-form-builder: 3.58.0
  @payloadcms/plugin-nested-docs: 3.58.0
  @payloadcms/plugin-redirects: 3.58.0
  @payloadcms/plugin-search: 3.58.0
  @payloadcms/plugin-seo: 3.58.0
  @payloadcms/richtext-lexical: 3.58.0
  @payloadcms/translations: 3.58.0
  @payloadcms/ui/shared: 3.58.0
  react: 19.1.0
  react-dom: 19.1.0
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:30 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6020
  Available memory (MB): 32768
  Available CPU cores: 12

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