payload icon indicating copy to clipboard operation
payload copied to clipboard

Breadcrumbs in admin header aren't updating when using custom view

Open dansrc opened this issue 1 year ago • 3 comments

Link to reproduction

https://github.com/payloadcms/payload/tree/v3.0.0-beta.113/examples/custom-components

Environment Info

Binaries: Node: 22.8.0 npm: 10.8.2 Yarn: 1.22.22 pnpm: 9.12.1 Relevant Packages: payload: 3.0.0-beta.106 next: 15.0.0-canary.160 @payloadcms/db-mongodb: 3.0.0-beta.106 @payloadcms/graphql: 3.0.0-beta.106 @payloadcms/next/utilities: 3.0.0-beta.106 @payloadcms/richtext-lexical: 3.0.0-beta.106 @payloadcms/translations: 3.0.0-beta.106 @payloadcms/ui/shared: 3.0.0-beta.106 react: 19.0.0-rc-5dcb0097-20240918 react-dom: 19.0.0-rc-5dcb0097-20240918 Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 23.6.0: Mon Jul 29 21:13:04 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6020 Available memory (MB): 32768 Available CPU cores: 10

Describe the Bug

When visiting a custom view after a collection list or document edit view, the breadcrumbs to the collection or document remain in the header.

Reproduction Steps

  1. Run the custom-components example (when I did this, beta branch was at 113, and the example was pinned to 106. But the problem persistend when I unpinned the payload/next dependencies too)
  2. Visit a collection and/or document edit view.
  3. Navigate to /admin/custom-default
  4. The header still shows [logo] / [ Collection Name ] / [Document Name]

I'd really like to override the actual dashboard component too (admin.components.Dashboard.Component) but the same thing happens

Image

Adapters and Plugins

No response

dansrc avatar Oct 12 '24 05:10 dansrc

any solution or any comments for above issue?

KBambharoliya avatar Nov 14 '24 18:11 KBambharoliya

This issue has been marked as stale due to lack of activity.

To keep this issue open, please indicate that it is still relevant in a comment below.

github-actions[bot] avatar Dec 13 '24 05:12 github-actions[bot]

It is relevant

kamasali-koushik avatar Dec 18 '24 10:12 kamasali-koushik

The bug/issue is still there

diegonc avatar May 09 '25 22:05 diegonc

I'm having the same problem

andrehil avatar Jul 18 '25 20:07 andrehil

Append the SetStepNav component inside DefaultTemplate:

<DefaultTemplate ...>
  <SetStepNav nav={[{ label: "My Custom Section" }]} />
</DefaultTemplate>

diegonc avatar Jul 18 '25 21:07 diegonc

I had found out about useStepNav, but I had to create a client component to use it. This is even better, thanks!

By the way, it would be nice if this were in the docs, especially this one https://payloadcms.com/docs/custom-components/custom-views#view-templates

andrehil avatar Jul 19 '25 16:07 andrehil

Append the SetStepNav component inside DefaultTemplate:

<DefaultTemplate ...>
  <SetStepNav nav={[{ label: "My Custom Section" }]} />
</DefaultTemplate>

I had the same problem and this is the solution. Please add it to custom-views documentation!

philippgerbig avatar Sep 15 '25 21:09 philippgerbig